mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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
This commit is contained in:
@@ -68,9 +68,10 @@ while ($device = mysql_fetch_array($device_query)) {
|
|||||||
#$snmp_cmd .= " | grep -v 'Cisco Internetwork Operating System Software'";
|
#$snmp_cmd .= " | grep -v 'Cisco Internetwork Operating System Software'";
|
||||||
if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
|
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 = $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 .= " .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";
|
||||||
$snmp_cmdb .= " | grep -v 'Cisco Internetwork Operating System Software'";
|
list($a,$b,$c,$d) = explode("\n", shell_exec($snmp_cmdb));
|
||||||
$ciscomodel = str_replace("\"", "", trim(`$snmp_cmdb`));
|
if($b == "0") { $ciscomodel = $a; }
|
||||||
|
if($d == "0") { $ciscomodel = $c; }
|
||||||
} else { unset($ciscomodel); }
|
} else { unset($ciscomodel); }
|
||||||
|
|
||||||
$snmpdata = shell_exec($snmp_cmd);
|
$snmpdata = shell_exec($snmp_cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user