diff --git a/includes/polling/os.inc.php b/includes/polling/os.inc.php index f2e4960d9..5af68fd24 100644 --- a/includes/polling/os.inc.php +++ b/includes/polling/os.inc.php @@ -2,7 +2,6 @@ if (is_file($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php")) { -echo "os = /includes/polling/os/".$device['os'].".inc.php\n"; /// OS Specific include($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php"); } diff --git a/includes/polling/os/cisco.inc.php b/includes/polling/os/cisco.inc.php index 3690d60b1..37f69c6b4 100644 --- a/includes/polling/os/cisco.inc.php +++ b/includes/polling/os/cisco.inc.php @@ -2,7 +2,6 @@ if (preg_match('/^Cisco IOS Software, .+? Software \([^\-]+-([\w\d]+)-\w\), Version ([^,]+)/', $poll_device['sysDescr'], $regexp_result)) { - $features = $regexp_result[1]; $version = $regexp_result[2]; } diff --git a/includes/polling/os/ios.inc.php b/includes/polling/os/ios.inc.php index 2384f43cc..825b5546e 100755 --- a/includes/polling/os/ios.inc.php +++ b/includes/polling/os/ios.inc.php @@ -3,34 +3,39 @@ # 7200 and IOS-XE (ASR1k) if (preg_match('/^Cisco IOS Software, .+? Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $poll_device['sysDescr'], $regexp_result)) { - $features = $regexp_result[1]; - $version = $regexp_result[2]; + $features = $regexp_result[1]; + $version = $regexp_result[2]; } # 7600 elseif (preg_match('/Cisco Internetwork Operating System Software\s+IOS \(tm\) [^ ]+ Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $poll_device['sysDescr'], $regexp_result)) { - $features = $regexp_result[1]; - $version = $regexp_result[2]; + $features = $regexp_result[1]; + $version = $regexp_result[2]; } -$oids = "entPhysicalModelName.1 entPhysicalContainedIn.1 entPhysicalName.1 entPhysicalSoftwareRev.1 entPhysicalModelName.1001 entPhysicalContainedIn.1001 cardDescr.1 cardSlotNumber.1"; - -$data = snmp_get_multi($device, $oids, "-OQUs", "ENTITY-MIB:OLD-CISCO-CHASSIS-MIB"); - -if ($data[1]['entPhysicalContainedIn'] == "0") +# If we have not managed to match any IOS string yet (and that would be surprising) +# we can try to poll the Entity Mib to see what's inside +else { - if (!empty($data[1]['entPhysicalSoftwareRev'])) + $oids = "entPhysicalModelName.1 entPhysicalContainedIn.1 entPhysicalName.1 entPhysicalSoftwareRev.1 entPhysicalModelName.1001 entPhysicalContainedIn.1001 cardDescr.1 cardSlotNumber.1"; + + $data = snmp_get_multi($device, $oids, "-OQUs", "ENTITY-MIB:OLD-CISCO-CHASSIS-MIB"); + + if ($data[1]['entPhysicalContainedIn'] == "0") { - $version = $data[1]['entPhysicalSoftwareRev']; - } - if (!empty($data[1]['entPhysicalName'])) - { - $hardware = $data[1]['entPhysicalName']; - } - if (!empty($data[1]['entPhysicalModelName'])) - { - $hardware = $data[1]['entPhysicalModelName']; + if (!empty($data[1]['entPhysicalSoftwareRev'])) + { + $version = $data[1]['entPhysicalSoftwareRev']; + } + if (!empty($data[1]['entPhysicalName'])) + { + $hardware = $data[1]['entPhysicalName']; + } + if (!empty($data[1]['entPhysicalModelName'])) + { + $hardware = $data[1]['entPhysicalModelName']; + } } }