2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2012-03-20 16:50:16 +00:00
|
|
|
# 7200 and IOS-XE (ASR1k)
|
|
|
|
if (preg_match('/^Cisco IOS Software, .+? Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $poll_device['sysDescr'], $regexp_result))
|
|
|
|
{
|
2012-03-20 23:56:40 +00:00
|
|
|
$features = $regexp_result[1];
|
|
|
|
$version = $regexp_result[2];
|
2012-03-20 16:50:16 +00:00
|
|
|
}
|
2011-10-10 15:40:54 +00:00
|
|
|
|
2012-03-20 16:50:16 +00:00
|
|
|
# 7600
|
|
|
|
elseif (preg_match('/Cisco Internetwork Operating System Software\s+IOS \(tm\) [^ ]+ Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $poll_device['sysDescr'], $regexp_result))
|
|
|
|
{
|
2012-03-20 23:56:40 +00:00
|
|
|
$features = $regexp_result[1];
|
|
|
|
$version = $regexp_result[2];
|
2012-03-20 16:50:16 +00:00
|
|
|
}
|
2011-03-15 11:59:47 +00:00
|
|
|
|
2012-03-20 23:56:40 +00:00
|
|
|
# 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
|
|
|
|
{
|
|
|
|
$oids = "entPhysicalModelName.1 entPhysicalContainedIn.1 entPhysicalName.1 entPhysicalSoftwareRev.1 entPhysicalModelName.1001 entPhysicalContainedIn.1001 cardDescr.1 cardSlotNumber.1";
|
2011-03-15 11:59:47 +00:00
|
|
|
|
2012-03-20 23:56:40 +00:00
|
|
|
$data = snmp_get_multi($device, $oids, "-OQUs", "ENTITY-MIB:OLD-CISCO-CHASSIS-MIB");
|
2011-03-15 11:59:47 +00:00
|
|
|
|
2012-03-20 23:56:40 +00:00
|
|
|
if ($data[1]['entPhysicalContainedIn'] == "0")
|
2011-03-15 11:59:47 +00:00
|
|
|
{
|
2012-03-20 23:56:40 +00:00
|
|
|
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'];
|
|
|
|
}
|
2011-03-15 11:59:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# if ($slot_1 == "-1" && strpos($descr_1, "No") === FALSE) { $ciscomodel = $descr_1; }
|
|
|
|
# if (($contained_1 == "0" || $name_1 == "Chassis") && strpos($model_1, "No") === FALSE) { $ciscomodel = $model_1; list($version_1) = explode(",",$ver_1); }
|
|
|
|
# if ($contained_1001 == "0" && strpos($model_1001, "No") === FALSE) { $ciscomodel = $model_1001; }
|
2010-07-23 13:42:28 +00:00
|
|
|
# $ciscomodel = str_replace("\"","",$ciscomodel);
|
2011-03-15 11:59:47 +00:00
|
|
|
# if ($ciscomodel) { $hardware = $ciscomodel; unset($ciscomodel); }
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2012-03-20 16:50:16 +00:00
|
|
|
if(empty($hardware)) { $hardware = snmp_get($device, "sysObjectID.0", "-Osqv", "SNMPv2-MIB:CISCO-PRODUCTS-MIB"); }
|
2011-10-10 15:40:54 +00:00
|
|
|
|
2011-10-10 15:50:14 +00:00
|
|
|
#if(isset($cisco_hardware_oids[$poll_device['sysObjectID']])) { $hardware = $cisco_hardware_oids[$poll_device['sysObjectID']]; }
|
2011-10-10 15:40:54 +00:00
|
|
|
|
2011-05-03 21:46:25 +00:00
|
|
|
?>
|