From 09e50ada345cd22562ce684ac76f25c60dc7d5d8 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 29 Mar 2012 12:05:45 +0000 Subject: [PATCH] ignore iftypes config option and checker git-svn-id: http://www.observium.org/svn/observer/trunk@2934 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/defaults.inc.php | 11 ++++++----- includes/functions.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index f1e56c551..a2fb5a663 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -235,13 +235,14 @@ $config['bad_if'][] = "span rp"; $config['bad_if'][] = "span sp"; $config['bad_if'][] = "sslvpn"; $config['bad_if'][] = "pppoe-"; -$config['bad_if'][] = "voiceencap"; -$config['bad_if'][] = "voicefxo"; -$config['bad_if'][] = "voicefxs"; -$config['bad_if'][] = "voiceoveratm"; -$config['bad_if'][] = "voiceoverframerelay"; #$config['bad_if'][] = "control plane"; ## Example for cisco control plane +$config['bad_iftype'][] = "voiceencap"; +$config['bad_iftype'][] = "voicefxo"; +$config['bad_iftype'][] = "voicefxs"; +$config['bad_iftype'][] = "voiceoveratm"; +$config['bad_iftype'][] = "voiceoverframerelay"; + $config['bad_if_regexp'][] = "/serial[0-9]:/"; $config['bad_if_regexp'][] = "/^ng[0-9]+$/"; $config['bad_if_regexp'][] = "/^sl[0-9]/"; diff --git a/includes/functions.php b/includes/functions.php index f6dc898e8..42bc637ff 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -611,6 +611,17 @@ function is_port_valid($port, $device) } } } + if (is_array($config['bad_iftype'])) + { + foreach ($config['bad_iftype'] as $bi) + { + if (strstr($port['ifType'], $bi)) + { + $valid = 0; + if ($debug) { echo("ignored ifType : ".$port['ifType']." (matched: ".$bi." )"); } + } + } + } if (empty($port['ifDescr'])) { $valid = 0; } if ($device['os'] == "catos" && strstr($if, "vlan")) { $valid = 0; } } else {