From 000ca589a9a3f70a3f37b6f55eb699ced87759a2 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 25 Sep 2009 12:41:17 +0000 Subject: [PATCH] improved handling of cisco models (check to see if the entity entry is child of nothing) git-svn-id: http://www.observium.org/svn/observer/trunk@476 61d68cd4-352d-0410-923a-c4978735b2b8 --- poll-device.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poll-device.php b/poll-device.php index 4fd928599..a09c493ca 100755 --- a/poll-device.php +++ b/poll-device.php @@ -68,9 +68,10 @@ while ($device = mysql_fetch_array($device_query)) { #$snmp_cmd .= " | grep -v 'Cisco Internetwork Operating System Software'"; if($device['os'] == "IOS" || $device['os'] == "IOS XE") { $snmp_cmdb = $config['snmpget'] . " -m ENTITY-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']; - $snmp_cmdb .= " .1.3.6.1.2.1.47.1.1.1.1.13.1"; - $snmp_cmdb .= " | grep -v 'Cisco Internetwork Operating System Software'"; - $ciscomodel = str_replace("\"", "", trim(`$snmp_cmdb`)); + $snmp_cmdb .= " .1.3.6.1.2.1.47.1.1.1.1.13.1 .1.3.6.1.2.1.47.1.1.1.1.4.1 .1.3.6.1.2.1.47.1.1.1.1.13.1001 .1.3.6.1.2.1.47.1.1.1.1.4.1001"; + list($a,$b,$c,$d) = explode("\n", shell_exec($snmp_cmdb)); + if($b == "0") { $ciscomodel = $a; } + if($d == "0") { $ciscomodel = $c; } } else { unset($ciscomodel); } $snmpdata = shell_exec($snmp_cmd);