diff --git a/database-update.sql b/database-update.sql index 187bc0c869..a1ca53a5ac 100644 --- a/database-update.sql +++ b/database-update.sql @@ -26,3 +26,5 @@ DROP TABLE `fanspeed`; DROP TABLE `temperature`; DROP TABLE `voltage`; DROP TABLE `current`; +ALTER TABLE `sensors` ADD `entPhysicalIndex` VARCHAR( 16 ) NULL; +ALTER TABLE `sensors` ADD `entPhysicalIndex_measured` VARCHAR(16) NULL; diff --git a/includes/discovery/temperatures/cisco-entity-sensor.inc.php b/includes/discovery/temperatures/cisco-entity-sensor.inc.php new file mode 100644 index 0000000000..f2bd8aa223 --- /dev/null +++ b/includes/discovery/temperatures/cisco-entity-sensor.inc.php @@ -0,0 +1,37 @@ + $entry) + { + #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']; + + discover_temperature($valid_temp, $device, $oid, $index, "cisco-entity-sensor", $descr, "1", NULL, NULL, $current); + } + } + } +} + + +?>