From 5d5d3816ef36b54901e10d9b82928331f51fe264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rosiak?= Date: Mon, 26 Jun 2017 22:40:50 +0200 Subject: [PATCH] fix: Make various Cisco sensor descriptions start with upper case (#6891) --- includes/discovery/mempools/cemp.inc.php | 2 +- includes/discovery/processors/ios.inc.php | 2 +- includes/discovery/sensors/cisco-entity-sensor.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/discovery/mempools/cemp.inc.php b/includes/discovery/mempools/cemp.inc.php index cc8ef7fe3a..de291b12bf 100644 --- a/includes/discovery/mempools/cemp.inc.php +++ b/includes/discovery/mempools/cemp.inc.php @@ -16,7 +16,7 @@ if ($device['os_group'] == 'cisco') { $descr = str_replace('Cisco ', '', $descr); $descr = str_replace('Network Processing Engine', '', $descr); - discover_mempool($valid_mempool, $device, $index, 'cemp', $descr, '1', $entPhysicalIndex, null); + discover_mempool($valid_mempool, $device, $index, 'cemp', ucwords($descr), '1', $entPhysicalIndex, null); } } } diff --git a/includes/discovery/processors/ios.inc.php b/includes/discovery/processors/ios.inc.php index c2859d3f41..9902cde961 100644 --- a/includes/discovery/processors/ios.inc.php +++ b/includes/discovery/processors/ios.inc.php @@ -32,7 +32,7 @@ if ($device['os_group'] == 'cisco' || $device['os'] == 'acsw') { rrd_file_rename($device, $old_name, $new_name); if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') { - discover_processor($valid['processor'], $device, $usage_oid, $index, 'cpm', $descr, '1', $usage, $entPhysicalIndex, null); + discover_processor($valid['processor'], $device, $usage_oid, $index, 'cpm', ucwords($descr), '1', $usage, $entPhysicalIndex, null); } }//end if }//end foreach diff --git a/includes/discovery/sensors/cisco-entity-sensor.inc.php b/includes/discovery/sensors/cisco-entity-sensor.inc.php index 12bb2d2aee..5f92d9c804 100644 --- a/includes/discovery/sensors/cisco-entity-sensor.inc.php +++ b/includes/discovery/sensors/cisco-entity-sensor.inc.php @@ -159,7 +159,7 @@ if ($device['os_group'] == 'cisco') { } //end if if ($ok) { - discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity']); + discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', ucwords($descr), $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity']); #Cisco IOS-XR : add a fake sensor to graph as dbm if ($type == "power" and $device['os'] == "iosxr" and (preg_match("/power (R|T)x/i", $descr) or preg_match("/(R|T)x Power/i", $descr))) { // convert Watts to dbm