From e2632b0759a166c865eea848cced2331681fc629 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Tue, 24 Mar 2009 10:45:51 +0000 Subject: [PATCH] fixing update-interface.php to use config variables for snmpget location and remove incorrect mib dir git-svn-id: http://www.observium.org/svn/observer/trunk@366 61d68cd4-352d-0410-923a-c4978735b2b8 --- update-interface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-interface.php b/update-interface.php index 423a425d7..600d80d4e 100755 --- a/update-interface.php +++ b/update-interface.php @@ -20,7 +20,7 @@ while ($interface = mysql_fetch_array($interface_query)) { echo("Looking at " . $interface['ifDescr'] . " on " . $device['hostname'] . "\n"); - $snmp_cmd = "snmpget -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ifName." . $interface['ifIndex']; + $snmp_cmd = $config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ifName." . $interface['ifIndex']; $snmp_cmd .= " ifDescr." . $interface['ifIndex'] . " ifAdminStatus." . $interface['ifIndex'] . " ifOperStatus." . $interface['ifIndex'] . " "; $snmp_cmd .= "ifAlias." . $interface['ifIndex'] . " ifSpeed." . $interface['ifIndex'] . " 1.3.6.1.2.1.10.7.2.1." . $interface['ifIndex']; $snmp_cmd .= " ifType." . $interface['ifIndex'] . " ifMtu." . $interface['ifIndex'] . " ifPhysAddress." . $interface['ifIndex']; @@ -32,7 +32,7 @@ while ($interface = mysql_fetch_array($interface_query)) { if($device['os'] == "IOS") { - $snmp_cmdb = "snmpget -M /usr/share/snmp/mibs/ -m CISCO-VLAN-MEMBERSHIP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']; + $snmp_cmdb = $config['snmpget'] . " -m +CISCO-VLAN-MEMBERSHIP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']; $snmp_cmdb .= " .1.3.6.1.4.1.9.2.2.1.1.1." . $interface['ifIndex']; $snmp_cmdb .= " .1.3.6.1.4.1.9.9.68.1.2.2.1.2." . $interface['ifIndex']; $snmp_cmdb .= " .1.3.6.1.4.1.9.9.46.1.6.1.1.16." . $interface['ifIndex'];