From c4e7ea7fbd0e52492fb0b2df79cd793a4136c0c2 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 21 Nov 2008 14:54:57 +0000 Subject: [PATCH] fixes git-svn-id: http://www.observium.org/svn/observer/trunk@313 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/interfaces.php | 5 ++--- includes/polling/interfaces.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/discovery/interfaces.php b/includes/discovery/interfaces.php index de151291bc..dfe1e1c1ab 100755 --- a/includes/discovery/interfaces.php +++ b/includes/discovery/interfaces.php @@ -19,12 +19,11 @@ list($ifIndex, $ifName) = explode("||", $entry); if($config['ifdescr'][$device['os']]) { - $ifDescr = shell_exec($config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifAlias.$ifIndex"); + $ifDescr = shell_exec($config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifDescr.$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); } else { $ifDescr = trim(str_replace("\"", "", $ifName)); } - if(!strstr($entry, "irtual")) { $ifName = trim(str_replace("\"", "", $ifName)); $if = trim(strtolower($ifName)); @@ -42,7 +41,7 @@ # Add Interface echo("+"); } else { - mysql_query("UPDATE `interfaces` SET `deleted` = '0' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex' AND `deleted` = '1'"); + mysql_query("UPDATE `interfaces` SET `deleted` = '0', `ifDescr` = '$ifDescr' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex' AND `deleted` = '1'"); if(mysql_affected_rows()) { echo("*"); } else { diff --git a/includes/polling/interfaces.inc.php b/includes/polling/interfaces.inc.php index cf8dcce7b8..dd4355046a 100644 --- a/includes/polling/interfaces.inc.php +++ b/includes/polling/interfaces.inc.php @@ -19,14 +19,14 @@ while ($interface = mysql_fetch_array($interface_query)) { echo("Looking at " . $interface['ifDescr'] . " on " . $device['hostname'] . "\n"); $snmp_cmd = $config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname']; - $snmp_cmd .= " ifAdminStatus." . $interface['ifIndex'] . " ifOperStatus." . $interface['ifIndex'] . " ifAlias." . $interface['ifIndex'] . " ifName." . $interface['ifIndex']; + $snmp_cmd .= " ifAdminStatus." . $interface['ifIndex'] . " ifOperStatus." . $interface['ifIndex'] . " ifAlias." . $interface['ifIndex']; $snmp_output = trim(`$snmp_cmd`); $snmp_output = str_replace("No Such Object available on this agent at this OID", "", $snmp_output); $snmp_output = str_replace("No Such Instance currently exists at this OID", "", $snmp_output); $snmp_output = str_replace("\"", "", $snmp_output); - list($ifAdminStatus, $ifOperStatus, $ifAlias, $ifName) = explode("\n", $snmp_output); + list($ifAdminStatus, $ifOperStatus, $ifAlias) = explode("\n", $snmp_output); if ($ifAlias == " ") { $ifAlias = str_replace(" ", "", $ifAlias); } $ifAlias = trim(str_replace("\"", "", $ifAlias));