2010-07-15 17:09:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
global $valid_temp;
|
2010-07-24 19:14:41 +00:00
|
|
|
|
|
|
|
unset($cisco_entity_temp);
|
2010-07-15 17:09:31 +00:00
|
|
|
|
|
|
|
if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
|
|
|
{
|
|
|
|
echo("CISCO-ENTITY-SENSOR");
|
|
|
|
|
|
|
|
$oids = array();
|
|
|
|
|
|
|
|
$oids = snmpwalk_cache_multi_oid($device, "entSensorType", $oids, "CISCO-ENTITY-SENSOR-MIB");
|
|
|
|
$oids = snmpwalk_cache_multi_oid($device, "entSensorScale", $oids, "CISCO-ENTITY-SENSOR-MIB");
|
|
|
|
$oids = snmpwalk_cache_multi_oid($device, "entSensorValue", $oids, "CISCO-ENTITY-SENSOR-MIB");
|
|
|
|
$oids = snmpwalk_cache_multi_oid($device, "entSensorMeasuredEntity", $oids, "CISCO-ENTITY-SENSOR-MIB");
|
|
|
|
|
|
|
|
if(is_array($oids[$device['device_id']]))
|
|
|
|
{
|
2010-07-18 21:52:49 +00:00
|
|
|
foreach($oids[$device['device_id']] as $index => $entry)
|
2010-07-15 17:09:31 +00:00
|
|
|
{
|
|
|
|
#echo("[" . $entry['entSensorType'] . "|" . $entry['entSensorValue']. "|" . $index . "]");
|
|
|
|
|
|
|
|
if($entry['entSensorType'] == "celsius" && is_numeric($entry['entSensorValue']) && is_numeric($index) && $entry['entSensorValue'] > "0" && $entry['entSensorValue'] < "1000")
|
|
|
|
{
|
|
|
|
$entPhysicalIndex = $index;
|
|
|
|
$entPhysicalIndex_measured = $entry['entSensorMeasuredEntity'];
|
|
|
|
$descr = snmp_get($device, "entPhysicalDescr.".$index, "-Oqv", "ENTITY-MIB");
|
|
|
|
$oid = ".1.3.6.1.4.1.9.9.91.1.1.1.1.4.".$index;
|
|
|
|
$current = $entry['entSensorValue'];
|
2010-07-18 08:20:30 +00:00
|
|
|
|
|
|
|
if($entry['entSensorScale'] == "milli") { $divisor = "1000"; } else { $divisor = "1"; }
|
2010-07-15 17:09:31 +00:00
|
|
|
|
2010-07-18 08:20:30 +00:00
|
|
|
discover_temperature($valid_temp, $device, $oid, $index, "cisco-entity-sensor", $descr, $divisor, NULL, NULL, $current);
|
2010-07-24 19:14:41 +00:00
|
|
|
|
|
|
|
$cisco_entity_temp = 1;
|
2010-07-15 17:09:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|