mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
fix blocking dsl0 ports (sl0!) and tidied some other stuff up
git-svn-id: http://www.observium.org/svn/observer/trunk@1993 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -154,13 +154,13 @@ $config['rancid_ignorecomments'] = 0; # Ignore lines starting with #
|
||||
|
||||
### Ignores & Allows
|
||||
|
||||
$config['bad_if'] = array("voip-null", "virtual-", "unrouted", "eobc", "mpls", "sl0", "lp0", "faith0",
|
||||
$config['bad_if'] = array("voip-null", "virtual-", "unrouted", "eobc", "mpls", "lp0", "faith0",
|
||||
"-atm layer", "-atm subif", "-shdsl", "-aal5", "-atm", "container",
|
||||
"async", "plip", "-physical", "-signalling", "container", "unrouted",
|
||||
"bri", "-bearer", "bluetooth", "isatap", "ras", "qos", "miniport", "sonet/sdh",
|
||||
"span rp", "span sp", "sslvpn");
|
||||
|
||||
$config['bad_if_regexp'] = array("/serial[0-9]:/");
|
||||
$config['bad_if_regexp'] = array("/serial[0-9]:/", "/^ng[0-9]+$/", "/^sl[0-9]/");
|
||||
|
||||
$config['processor_filter'][] = "An electronic chip that makes the computer work.";
|
||||
|
||||
|
||||
@@ -21,7 +21,14 @@ foreach (explode("\n", $ports) as $entry)
|
||||
{
|
||||
$if = trim(strtolower($ifDescr));
|
||||
$nullintf = 0;
|
||||
foreach ($config['bad_if'] as $bi) { if (strstr($if, $bi)) { $nullintf = 1; } }
|
||||
foreach ($config['bad_if'] as $bi)
|
||||
{
|
||||
if (strstr($if, $bi))
|
||||
{
|
||||
$nullintf = 1;
|
||||
if($debug) { echo("ignored : $bi : $if"); }
|
||||
}
|
||||
}
|
||||
if (is_array($config['bad_if_regexp']))
|
||||
{
|
||||
foreach ($config['bad_if_regexp'] as $bi)
|
||||
@@ -29,6 +36,7 @@ foreach (explode("\n", $ports) as $entry)
|
||||
if (preg_match($bi ."i", $if))
|
||||
{
|
||||
$nullintf = 1;
|
||||
if($debug) { echo("ignored : $bi : $if"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,11 +45,6 @@ foreach (explode("\n", $ports) as $entry)
|
||||
if ($device['os'] == "catos" && strstr($if, "vlan")) { $nullintf = 1; }
|
||||
if ($device['os'] == "vmware" && preg_match("/Device ([a-z0-9]+) at .*/", $ifDescr, $matches)) { $ifDescr = $matches[1]; }
|
||||
$ifDescr = fixifName($ifDescr);
|
||||
if (preg_match('/serial[0-9]:/', $if)) { $nullintf = 1; }
|
||||
if (isset($config['allow_ng']) && !$config['allow_ng'])
|
||||
{
|
||||
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = 1; }
|
||||
}
|
||||
if ($debug) echo("\n $if ");
|
||||
if ($nullintf == 0)
|
||||
{
|
||||
|
||||
@@ -46,6 +46,8 @@ if ($config['enable_ports_adsl'])
|
||||
$device['adsl_count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifType` = 'adsl'"),0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($device['adsl_count'] > "0")
|
||||
{
|
||||
echo("ADSL ");
|
||||
|
||||
Reference in New Issue
Block a user