diff --git a/discover-ifs.php b/discover-ifs.php index 337568449..49301d2d4 100755 --- a/discover-ifs.php +++ b/discover-ifs.php @@ -22,7 +22,7 @@ while ($device = mysql_fetch_row($device_query)) { $ifName = trim(str_replace("\"", "", $ifName)); $if = trim(strtolower($ifName)); $nullintf = 0; - foreach($bif as $bi) { + foreach($config['bad_if'] as $bi) { # echo("'$bi' -> '$if'\n"); diff --git a/includes/functions.php b/includes/functions.php index a10a2d4ae..521aa5623 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -416,10 +416,10 @@ function is_odd($number) { } function isValidInterface($if) { + global $config; $if = strtolower($if); - $bif = array("null", "virtual-", "unrouted", "eobc", "mpls", "aal5", "-atm layer", "dialer", "-shdsl", "-adsl", "async", "sit0", "sit1"); $nullintf = 0; - foreach($bif as $bi) { + foreach($config['bad_if'] as $bi) { $pos = strpos($if, $bi); if ($pos !== FALSE) { $nullintf = 1; @@ -546,25 +546,6 @@ function fixIOSHardware($hardware){ } -#function getHostOS($host, $community, $snmpver) { -# $sysDescr = trim(`snmpget -O qv -$snmpver -c $community $host sysDescr.0`); -# if ($sysDescr == "") {$sysDescr = trim(`snmpget -O qv -$snmpver -c $community $host 1.3.6.1.2.1.7526.2.4`);} -# echo("\nsnmpget -O qv -$snmpver -c $community $host sysDescr.0\n$sysDescr\n"); -# if (strstr($sysDescr, "IOS") !== false) { $os = "IOS"; } -# if (strstr($sysDescr, "FreeBSD") !== false) { $os = "FreeBSD"; } -# if (strstr($sysDescr, "DragonFly")) { $os = "DragonFly"; } -# if (strstr($sysDescr, "NetBSD") !== false) { $os = "NetBSD"; } -# if (strstr($sysDescr, "OpenBSD") !== false) { $os = "OpenBSD"; } -# if (strstr($sysDescr, "Linux") !== false) { $os = "Linux"; } -# if (strstr($sysDescr, "Windows")) { $os = "Windows"; } -# if (strstr($sysDescr, "ProCurve")) { $os = "ProCurve"; } -# if (strstr($sysDescr, "m0n0wall")) { $os = "m0n0wall"; } -# if (strstr($sysDescr, "Voswall")) { $os = "Voswall"; } -# if (strstr($sysDescr, "snom")) { $os = "Snom"; } -# return $os; -#} - - function createHost ($host, $community, $snmpver){ $host = trim(strtolower($host)); $host_os = getHostOS($host, $community, $snmpver);