2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2009-05-06 16:50:51 +00:00
|
|
|
$sysDescr = str_replace("IOS (tm)", "IOS (tm),", $sysDescr);
|
|
|
|
list(,$features,$version) = explode(",", $sysDescr);
|
|
|
|
$version = str_replace(" Version ", "", $version);
|
|
|
|
list(,$features) = explode("(", $features);
|
|
|
|
list(,$features) = explode("-", $features);
|
2008-03-12 13:55:50 +00:00
|
|
|
|
2010-07-23 13:42:28 +00:00
|
|
|
$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");
|
|
|
|
|
2010-07-30 18:33:08 +00:00
|
|
|
#print_r($data);
|
2010-07-23 13:42:28 +00:00
|
|
|
|
|
|
|
if($data[1]['entPhysicalContainedIn'] == "0")
|
|
|
|
{
|
|
|
|
if(isset($data[1]['entPhysicalSoftwareRev']) && $data[1]['entPhysicalSoftwareRev'] != "")
|
|
|
|
{
|
|
|
|
$version = $data[1]['entPhysicalSoftwareRev'];
|
|
|
|
}
|
|
|
|
if(isset($data[1]['entPhysicalName']) && $data[1]['entPhysicalName'] != "")
|
|
|
|
{
|
|
|
|
$hardware = $data[1]['entPhysicalName'];
|
|
|
|
}
|
|
|
|
if(isset($data[1]['entPhysicalModelName']) && $data[1]['entPhysicalModelName'] != "")
|
|
|
|
{
|
|
|
|
$hardware = $data[1]['entPhysicalModelName'];
|
|
|
|
}
|
2010-07-18 08:20:30 +00:00
|
|
|
}
|
|
|
|
|
2010-07-25 18:42:01 +00:00
|
|
|
list($version) = explode(",", $version);
|
2010-07-25 18:40:39 +00:00
|
|
|
|
2009-11-24 23:58:56 +00:00
|
|
|
|
2009-04-24 15:04:45 +00:00
|
|
|
|
2010-07-23 13:42:28 +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; }
|
|
|
|
# $ciscomodel = str_replace("\"","",$ciscomodel);
|
|
|
|
# if($ciscomodel) { $hardware = $ciscomodel; unset($ciscomodel); }
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2010-07-23 13:42:28 +00:00
|
|
|
# if(strpos($sysDescr, "IOS XR")) {
|
|
|
|
# list(,$version) = explode(",", $sysDescr);
|
|
|
|
# $version = trim($version);
|
|
|
|
# list(,$version) = explode(" ", $version);
|
|
|
|
# list($version) = explode("\n", $version);
|
|
|
|
# trim($version);
|
|
|
|
# }
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2009-11-10 10:19:30 +00:00
|
|
|
|
2010-07-23 13:42:28 +00:00
|
|
|
echo("$hostname\n");
|
2009-11-10 10:19:30 +00:00
|
|
|
|
2008-03-17 00:23:52 +00:00
|
|
|
|
2007-04-08 21:26:41 +00:00
|
|
|
?>
|