fix: Fix bad Cisco dBm discovery on some IOS versions (#6789)

This commit is contained in:
Søren Rosiak
2017-06-06 23:46:29 +02:00
committed by Neil Lathwood
parent 1c1ad7a9be
commit cbe476ad2f

View File

@ -34,13 +34,16 @@ $entitysensor['dBm'] = 'dbm';
if (is_array($oids)) {
foreach ($oids as $index => $entry) {
// echo("[" . $entry['entPhySensorType'] . "|" . $entry['entPhySensorValue']. "|" . $index . "]");
// Fix for Cisco ASR920, 15.5(2)S
if ($entry['entPhySensorType'] == 'other' && str_contains($entity_array[$index]['entPhysicalName'], array('Rx Power Sensor', 'Tx Power Sensor'))) {
$entitysensor['other'] = 'dbm';
}
if ($entitysensor[$entry['entPhySensorType']] && is_numeric($entry['entPhySensorValue']) && is_numeric($index)) {
$entPhysicalIndex = $index;
$oid = '.1.3.6.1.2.1.99.1.1.1.4.'.$index;
$current = $entry['entPhySensorValue'];
// ENTITY-SENSOR-MIB::entPhySensorUnitsDisplay.11 = STRING: "C"
$descr = $entity_array[$index]['entPhysicalName'];
$descr = ucwords($entity_array[$index]['entPhysicalName']);
// if ($descr || $device['os'] == "iosxr")
if ($descr) {
$descr = rewrite_entity_descr($descr);