mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
bug fixes and security fixes
git-svn-id: http://www.observium.org/svn/observer/trunk@307 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
|
||||
$entry = trim($entry);
|
||||
list($ifIndex, $ifName) = explode("||", $entry);
|
||||
$ifDescr = $config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifAlias.$ifIndex";
|
||||
$ifDescr = str_replace("No Such Object available on this agent at this OID", "", $ifDescr);
|
||||
$ifDescr = str_replace("No Such Instance currently exists at this OID", "", $ifDescr);
|
||||
|
||||
if(!strstr($entry, "irtual")) {
|
||||
$ifName = trim(str_replace("\"", "", $ifName));
|
||||
$if = trim(strtolower($ifName));
|
||||
@@ -30,7 +34,7 @@
|
||||
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') {
|
||||
mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifName')");
|
||||
mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifDescr')");
|
||||
# Add Interface
|
||||
echo("+");
|
||||
} else {
|
||||
@@ -43,9 +47,15 @@
|
||||
}
|
||||
$int_exists[] = "$ifIndex";
|
||||
} else {
|
||||
# Ignored Interface
|
||||
echo("$if \n");
|
||||
echo("X");
|
||||
# Ignored Interface
|
||||
#echo("$if \n");
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) != '0') {
|
||||
mysql_query("UPDATE `interfaces` SET `deleted` = '1' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'");
|
||||
# Delete Interface
|
||||
echo("-"); ## Deleted Interface
|
||||
} else {
|
||||
echo("X"); ## Ignored Interface
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user