mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
implement bad_if_regexp regular expression filter for port ifDescr (clean and allow for portName and ifName too?) (thanks thevoke!)
git-svn-id: http://www.observium.org/svn/observer/trunk@1069 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -22,6 +22,14 @@
|
||||
$if = trim(strtolower($ifDescr));
|
||||
$nullintf = 0;
|
||||
foreach($config['bad_if'] as $bi) { if (strstr($if, $bi)) { $nullintf = 1; } }
|
||||
if(is_array($config['bad_if_regexp'])) {
|
||||
foreach($config['bad_if_regexp'] as $bi) {
|
||||
if (preg_match($bi ."i", $if)) {
|
||||
$nullintf = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($device['os'] == "catos" && strstr($if, "vlan") ) { $nullintf = 1; }
|
||||
$ifDescr = fixifName($ifDescr);
|
||||
if (preg_match('/serial[0-9]:/', $if)) { $nullintf = 1; }
|
||||
|
Reference in New Issue
Block a user