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:
Adam Amstrong
2010-04-22 23:22:11 +00:00
parent 38a33e5661
commit 34a17ee537

View File

@ -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; }