mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add CISCO-ENTITY-SENSOR-MIB discovery for temperatures only (probably going to be some overlap with CISCO-ENVMON-MIB)
git-svn-id: http://www.observium.org/svn/observer/trunk@1356 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -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;
|
||||
|
37
includes/discovery/temperatures/cisco-entity-sensor.inc.php
Normal file
37
includes/discovery/temperatures/cisco-entity-sensor.inc.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
global $valid_temp;
|
||||
|
||||
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']]))
|
||||
{
|
||||
foreach($oids[$device[device_id]] as $index => $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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user