git-svn-id: http://www.observium.org/svn/observer/trunk@480 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-10-05 12:47:16 +00:00
parent f2426873d5
commit b4c80a1c85
12 changed files with 45 additions and 22 deletions
+6 -9
View File
@@ -30,15 +30,12 @@
if(!strstr($entry, "irtual")) {
$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($device['os'] == "CatOS" && strstr($if, "vlan") ) { $nullintf = 1; }
$ifDescr = fixifName($ifDescr);
if (preg_match('/serial[0-9]:/', $if)) { $nullintf = '1'; }
if (preg_match('/serial[0-9]:/', $if)) { $nullintf = 1; }
if(!$config['allow_ng']) {
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = '1'; }
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = 1; }
}
if ($nullintf == 0) {
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) == '0') {
@@ -46,8 +43,8 @@
# Add Interface
echo("+");
} else {
mysql_query("UPDATE `interfaces` SET `deleted` = '0', `ifDescr` = '$ifDescr' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'");
if(mysql_affected_rows()) {
if($interface['deleted']) {
mysql_query("UPDATE `interfaces` SET `deleted` = '0' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'");
echo("*");
} else {
echo(".");