From d95cf4ac16b8bf26a5dc5b776a99a640d56d53c7 Mon Sep 17 00:00:00 2001 From: crcro Date: Thu, 11 Aug 2016 17:49:34 +0300 Subject: [PATCH 1/8] added hardware model, software version, fans and ps sensor states, removed header cpu and memory graphs --- includes/definitions.inc.php | 4 - .../discovery/sensors/states/hpblmos.inc.php | 127 ++++++++++++++++++ includes/polling/os/hpblmos.inc.php | 3 + 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 includes/discovery/sensors/states/hpblmos.inc.php create mode 100644 includes/polling/os/hpblmos.inc.php diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index 6e1cd4fa5d73..89bcb1b80594 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1787,10 +1787,6 @@ $config['os'][$os]['icon'] = 'hp'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; $config['os'][$os]['over'][0]['text'] = 'Traffic'; -$config['os'][$os]['over'][1]['graph'] = 'device_processor'; -$config['os'][$os]['over'][1]['text'] = 'CPU Usage'; -$config['os'][$os]['over'][2]['graph'] = 'device_mempool'; -$config['os'][$os]['over'][2]['text'] = 'Memory Usage'; // HP MSM $os = 'hpmsm'; diff --git a/includes/discovery/sensors/states/hpblmos.inc.php b/includes/discovery/sensors/states/hpblmos.inc.php new file mode 100644 index 000000000000..082c0c6f5aee --- /dev/null +++ b/includes/discovery/sensors/states/hpblmos.inc.php @@ -0,0 +1,127 @@ + $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } + } + + discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index); + create_sensor_to_state_index($device, $state_name, $index); + $index++; + } + } + + $index = 1; + $state_name = 'hpblmos_PowerSupplyState'; + $state_descr = 'Power supply '; + $oids = array( + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.1', + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.2', + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.3', + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.4', + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.5', + '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.6', + ); + + /* CPQRACK-MIB::cpqRackPowerSupplyTable + * 1 - other + * 2 - ok + * 3 - degraded + * 4 - failed + */ + + foreach($oids as $oid) { + $state = snmp_get($device, $oid, '-Oqv'); + $descr = $state_descr . $index; + + if(!empty($state)) + { + $state_index_id = create_state_index($state_name); + + if($state_index_id) + { + $states = array( + array($state_index_id, 'other', 0, 1, 3), + array($state_index_id, 'ok', 1, 2, 0), + array($state_index_id, 'degraded', 1, 3, 1), + array($state_index_id, 'failed', 1, 4, 2), + ); + + foreach($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } + } + + discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index); + create_sensor_to_state_index($device, $state_name, $index); + $index++; + } + } +} diff --git a/includes/polling/os/hpblmos.inc.php b/includes/polling/os/hpblmos.inc.php new file mode 100644 index 000000000000..18f34794cc0f --- /dev/null +++ b/includes/polling/os/hpblmos.inc.php @@ -0,0 +1,3 @@ + Date: Fri, 12 Aug 2016 15:02:58 +0300 Subject: [PATCH 2/8] rewrite the discovery module based on presence oid --- .../discovery/sensors/states/hpblmos.inc.php | 170 +++++++----------- 1 file changed, 64 insertions(+), 106 deletions(-) diff --git a/includes/discovery/sensors/states/hpblmos.inc.php b/includes/discovery/sensors/states/hpblmos.inc.php index 082c0c6f5aee..1d08e227e8d6 100644 --- a/includes/discovery/sensors/states/hpblmos.inc.php +++ b/includes/discovery/sensors/states/hpblmos.inc.php @@ -1,127 +1,85 @@ $value[0], - 'state_descr' => $value[1], - 'state_draw_graph' => $value[2], - 'state_value' => $value[3], - 'state_generic_value' => $value[4] + $state_index_id = create_state_index($fan_state_name); + if($state_index_id) + { + $states = array( + array($state_index_id, 'other', 0, 1, 3), + array($state_index_id, 'ok', 1, 2, 0), + array($state_index_id, 'degraded', 1, 3, 1), + array($state_index_id, 'failed', 1, 4, 2), ); - dbInsert($insert, 'state_translations'); - } - } - discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index); - create_sensor_to_state_index($device, $state_name, $index); - $index++; + foreach($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } + } + discover_sensor($valid['sensor'], 'state', $device, $fan_state_oid.$fanid, $fanid, $fan_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $fanid); + create_sensor_to_state_index($device, $fan_state_name, $fanid); + } } } - $index = 1; - $state_name = 'hpblmos_PowerSupplyState'; - $state_descr = 'Power supply '; - $oids = array( - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.1', - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.2', - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.3', - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.4', - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.5', - '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.6', - ); - - /* CPQRACK-MIB::cpqRackPowerSupplyTable - * 1 - other - * 2 - ok - * 3 - degraded - * 4 - failed - */ - - foreach($oids as $oid) { - $state = snmp_get($device, $oid, '-Oqv'); - $descr = $state_descr . $index; - - if(!empty($state)) + for($psuid = 1; $psuid < 7; $psuid++) + { + if (snmp_get($device, $psu_exists_oid.$psuid, '-Oqve') != 2) { - $state_index_id = create_state_index($state_name); + $state = snmp_get($device, $psu_state_oid.$psuid, '-Oqv'); + $descr = $psu_state_descr.$psuid; - if($state_index_id) + if (!empty($state)) { - $states = array( - array($state_index_id, 'other', 0, 1, 3), - array($state_index_id, 'ok', 1, 2, 0), - array($state_index_id, 'degraded', 1, 3, 1), - array($state_index_id, 'failed', 1, 4, 2), - ); - - foreach($states as $value) { - $insert = array( - 'state_index_id' => $value[0], - 'state_descr' => $value[1], - 'state_draw_graph' => $value[2], - 'state_value' => $value[3], - 'state_generic_value' => $value[4] + $state_index_id = create_state_index($psu_state_name); + if($state_index_id) + { + $states = array( + array($state_index_id, 'other', 0, 1, 3), + array($state_index_id, 'ok', 1, 2, 0), + array($state_index_id, 'degraded', 1, 3, 1), + array($state_index_id, 'failed', 1, 4, 2), ); - dbInsert($insert, 'state_translations'); + + foreach($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } } } - - discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index); - create_sensor_to_state_index($device, $state_name, $index); - $index++; + discover_sensor($valid['sensor'], 'state', $device, $psu_state_oid.$psuid, $psuid, $psu_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $psuid); + create_sensor_to_state_index($device, $psu_state_name, $psuid); } } } From 709e941c777a1a72bf63476683a9277fc7f113c9 Mon Sep 17 00:00:00 2001 From: crcro Date: Sat, 13 Aug 2016 03:25:28 +0300 Subject: [PATCH 3/8] fixes - PSR-2 style --- .../discovery/sensors/states/hpblmos.inc.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/includes/discovery/sensors/states/hpblmos.inc.php b/includes/discovery/sensors/states/hpblmos.inc.php index 1d08e227e8d6..42d6e4401fc8 100644 --- a/includes/discovery/sensors/states/hpblmos.inc.php +++ b/includes/discovery/sensors/states/hpblmos.inc.php @@ -1,6 +1,5 @@ Date: Sat, 13 Aug 2016 15:10:45 +0300 Subject: [PATCH 4/8] added sensors for power usage and temperatures of the blade system --- .../discovery/sensors/power/hpblmos.inc.php | 20 +++++++++++++++++++ .../sensors/temperatures/hpblmos.inc.php | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 includes/discovery/sensors/power/hpblmos.inc.php create mode 100644 includes/discovery/sensors/temperatures/hpblmos.inc.php diff --git a/includes/discovery/sensors/power/hpblmos.inc.php b/includes/discovery/sensors/power/hpblmos.inc.php new file mode 100644 index 000000000000..411a600f10ba --- /dev/null +++ b/includes/discovery/sensors/power/hpblmos.inc.php @@ -0,0 +1,20 @@ + 0) { + discover_sensor($valid['sensor'], 'temperature', $device, $sensor_value_oid.$tempid, '1', $sensor_type, $descr, 1, 1, null, null, null, null, $value); + } + } + } +} \ No newline at end of file From b201e642d83879c680bd79c59a07727a4691377a Mon Sep 17 00:00:00 2001 From: crcro Date: Sat, 13 Aug 2016 15:42:43 +0300 Subject: [PATCH 5/8] fix: sensor id for rrd file --- includes/discovery/sensors/power/hpblmos.inc.php | 2 +- includes/discovery/sensors/temperatures/hpblmos.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/discovery/sensors/power/hpblmos.inc.php b/includes/discovery/sensors/power/hpblmos.inc.php index 411a600f10ba..dfc26203a75a 100644 --- a/includes/discovery/sensors/power/hpblmos.inc.php +++ b/includes/discovery/sensors/power/hpblmos.inc.php @@ -13,7 +13,7 @@ $max_value = snmp_get($device, $psu_max_usage_oid.$psuid, '-Oqv'); if (is_numeric($value)) { - discover_sensor($valid['sensor'], 'power', $device, $psu_usage_oid.$psuid, '1', $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value); + discover_sensor($valid['sensor'], 'power', $device, $psu_usage_oid.$psuid, $psuid, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value); } } } diff --git a/includes/discovery/sensors/temperatures/hpblmos.inc.php b/includes/discovery/sensors/temperatures/hpblmos.inc.php index 6a48e45dc8a9..9e4f1e8258c9 100644 --- a/includes/discovery/sensors/temperatures/hpblmos.inc.php +++ b/includes/discovery/sensors/temperatures/hpblmos.inc.php @@ -12,7 +12,7 @@ $value = snmp_get($device, $sensor_value_oid.$tempid, '-Oqve'); if ($value > 0) { - discover_sensor($valid['sensor'], 'temperature', $device, $sensor_value_oid.$tempid, '1', $sensor_type, $descr, 1, 1, null, null, null, null, $value); + discover_sensor($valid['sensor'], 'temperature', $device, $sensor_value_oid.$tempid, $tempid, $sensor_type, $descr, 1, 1, null, null, null, null, $value); } } } From b4354b3801c0ee719b7da52e1a573cde9ed25e23 Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 16 Aug 2016 05:48:47 +0300 Subject: [PATCH 6/8] rewrite to use snmp_walk against snmp_get for fewer device queries --- .../discovery/sensors/power/hpblmos.inc.php | 24 ++-- .../discovery/sensors/states/hpblmos.inc.php | 129 ++++++++++-------- .../sensors/temperatures/hpblmos.inc.php | 23 ++-- 3 files changed, 105 insertions(+), 71 deletions(-) diff --git a/includes/discovery/sensors/power/hpblmos.inc.php b/includes/discovery/sensors/power/hpblmos.inc.php index dfc26203a75a..df8d87df930b 100644 --- a/includes/discovery/sensors/power/hpblmos.inc.php +++ b/includes/discovery/sensors/power/hpblmos.inc.php @@ -2,18 +2,26 @@ if ($device['os'] == 'hpblmos') { $sensor_type = 'hpblmos_psu_usage'; - $psu_exists_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16.'; + //$psu_exists_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16.'; + $psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16'; $psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.'; $psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.'; - for ($psuid = 1; $psuid < 7; $psuid++) { - if (snmp_get($device, $psu_exists_oid.$psuid, '-Oqve') != 2) { - $descr = 'PSU '.$psuid.' output'; - $value = snmp_get($device, $psu_usage_oid.$psuid, '-Oqv'); - $max_value = snmp_get($device, $psu_max_usage_oid.$psuid, '-Oqv'); + $psus = trim(snmp_walk($device, $psu_oid, '-Osqn')); - if (is_numeric($value)) { - discover_sensor($valid['sensor'], 'power', $device, $psu_usage_oid.$psuid, $psuid, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value); + foreach (explode("\n", $psus) as $psu) { + $psu = trim($psu); + if ($psu) { + list($oid, $presence) = explode(' ', $psu, 2); + if ($presence != 2) { + $split_oid = explode('.', $oid); + $current_id = $split_oid[(count($split_oid) - 1)]; + $current_oid = $psu_usage_oid.$current_id; + $psu_max_oid = $psu_max_usage_oid.$current_id; + $descr = 'PSU '.$psuid.' output'; + $value = snmp_get($device, $current_oid, '-Oqv'); + $max_value = snmp_get($device, $psu_max_oid, '-Oqv'); + discover_sensor($valid['sensor'], 'power', $device, $current_oid, $current_id, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value); } } } diff --git a/includes/discovery/sensors/states/hpblmos.inc.php b/includes/discovery/sensors/states/hpblmos.inc.php index 42d6e4401fc8..9ff40fe13193 100644 --- a/includes/discovery/sensors/states/hpblmos.inc.php +++ b/includes/discovery/sensors/states/hpblmos.inc.php @@ -1,76 +1,95 @@ $value[0], - 'state_descr' => $value[1], - 'state_draw_graph' => $value[2], - 'state_value' => $value[3], - 'state_generic_value' => $value[4] + foreach (explode("\n", $fans) as $fan) { + $fan = trim($fan); + if ($fan) { + list($oid, $presence) = explode(' ', $fan, 2); + if ($presence != 2) { + $split_oid = explode('.', $oid); + $current_id = $split_oid[(count($split_oid) - 1)]; + $current_oid = $fan_state_oid.$current_id; + $descr = $fan_state_descr.$current_id; + $state = snmp_get($device, $current_oid, '-Oqv'); + if (!empty($state)) { + $state_index_id = create_state_index($fan_state_name); + if ($state_index_id) { + $states = array( + array($state_index_id, 'other', 0, 1, 3), + array($state_index_id, 'ok', 1, 2, 0), + array($state_index_id, 'degraded', 1, 3, 1), + array($state_index_id, 'failed', 1, 4, 2), ); - dbInsert($insert, 'state_translations'); + + foreach ($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } } } - discover_sensor($valid['sensor'], 'state', $device, $fan_state_oid.$fanid, $fanid, $fan_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $fanid); - create_sensor_to_state_index($device, $fan_state_name, $fanid); - } + discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $fan_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $current_id); + create_sensor_to_state_index($device, $fan_state_name, $current_id); + } } + + } - for($psuid = 1; $psuid < 7; $psuid++) { - if (snmp_get($device, $psu_exists_oid.$psuid, '-Oqve') != 2) { - $state = snmp_get($device, $psu_state_oid.$psuid, '-Oqv'); - $descr = $psu_state_descr.$psuid; + $psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16'; + $psu_state_name = 'hpblmos_psustate'; + $psu_state_descr = 'PSU '; + $psu_state_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.17.'; - if (!empty($state)) { - $state_index_id = create_state_index($psu_state_name); - if($state_index_id) { - $states = array( - array($state_index_id, 'other', 0, 1, 3), - array($state_index_id, 'ok', 1, 2, 0), - array($state_index_id, 'degraded', 1, 3, 1), - array($state_index_id, 'failed', 1, 4, 2), - ); + $psus = trim(snmp_walk($device, $psu_oid, '-Osqn')); - foreach($states as $value) { - $insert = array( - 'state_index_id' => $value[0], - 'state_descr' => $value[1], - 'state_draw_graph' => $value[2], - 'state_value' => $value[3], - 'state_generic_value' => $value[4] + foreach (explode("\n", $psus) as $psu) { + $psu = trim($psu); + if ($psu) { + list($oid, $presence) = explode(' ', $psu, 2); + if ($presence != 2) { + $split_oid = explode('.', $oid); + $current_id = $split_oid[(count($split_oid) - 1)]; + $current_oid = $psu_state_oid.$current_id; + $descr = $psu_state_descr.$current_id; + $state = snmp_get($device, $current_oid, '-Oqv'); + if (!empty($state)) { + $state_index_id = create_state_index($psu_state_name); + if ($state_index_id) { + $states = array( + array($state_index_id, 'other', 0, 1, 3), + array($state_index_id, 'ok', 1, 2, 0), + array($state_index_id, 'degraded', 1, 3, 1), + array($state_index_id, 'failed', 1, 4, 2), ); - dbInsert($insert, 'state_translations'); + + foreach ($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } } } + discover_sensor($valid['sensor'], 'state', $device, $current_oid, $current_id, $psu_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $current_id); + create_sensor_to_state_index($device, $psu_state_name, $current_id); } - discover_sensor($valid['sensor'], 'state', $device, $psu_state_oid.$psuid, $psuid, $psu_state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $psuid); - create_sensor_to_state_index($device, $psu_state_name, $psuid); } } } diff --git a/includes/discovery/sensors/temperatures/hpblmos.inc.php b/includes/discovery/sensors/temperatures/hpblmos.inc.php index 9e4f1e8258c9..d0b733321be7 100644 --- a/includes/discovery/sensors/temperatures/hpblmos.inc.php +++ b/includes/discovery/sensors/temperatures/hpblmos.inc.php @@ -2,17 +2,24 @@ if ($device['os'] == 'hpblmos') { $sensor_type = 'hpblmos_temps'; - $sensor_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.5.'; + $temps_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.5'; + //$sensor_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.5.'; $sensor_value_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.6.'; - for ($tempid = 1; $tempid < 61; $tempid++) { - $sensor_descr = snmp_get($device, $sensor_oid.$tempid, '-Oqve'); - if ($sensor_descr != "") { - $descr = 'Temperature '.$sensor_descr.''; - $value = snmp_get($device, $sensor_value_oid.$tempid, '-Oqve'); + $temps = trim(snmp_walk($device, $temps_oid, '-Osqn')); - if ($value > 0) { - discover_sensor($valid['sensor'], 'temperature', $device, $sensor_value_oid.$tempid, $tempid, $sensor_type, $descr, 1, 1, null, null, null, null, $value); + foreach (explode("\n", $temps) as $temp) { + $temp = trim($temp); + if ($temp) { + list($oid, $descr) = explode(' ', $temp, 2); + if ($descr != "") { + $split_oid = explode('.', $oid); + $current_id = $split_oid[(count($split_oid) - 1)]; + $current_oid = $sensor_value_oid.$current_id; + $value = snmp_get($device, $current_oid, '-Oqve'); + if ($value > 0) { + discover_sensor($valid['sensor'], 'temperature', $device, $current_oid, $current_id, $sensor_type, $descr, 1, 1, null, null, null, null, $value); + } } } } From 2bf54f106b23663ee0981a18a96560e2d311c349 Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 16 Aug 2016 05:50:45 +0300 Subject: [PATCH 7/8] removed useless comments --- includes/discovery/sensors/power/hpblmos.inc.php | 3 +-- includes/discovery/sensors/temperatures/hpblmos.inc.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/discovery/sensors/power/hpblmos.inc.php b/includes/discovery/sensors/power/hpblmos.inc.php index df8d87df930b..7067af91aecf 100644 --- a/includes/discovery/sensors/power/hpblmos.inc.php +++ b/includes/discovery/sensors/power/hpblmos.inc.php @@ -2,7 +2,6 @@ if ($device['os'] == 'hpblmos') { $sensor_type = 'hpblmos_psu_usage'; - //$psu_exists_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16.'; $psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16'; $psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.'; $psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.'; @@ -25,4 +24,4 @@ } } } -} \ No newline at end of file +} diff --git a/includes/discovery/sensors/temperatures/hpblmos.inc.php b/includes/discovery/sensors/temperatures/hpblmos.inc.php index d0b733321be7..e5c74fd2b453 100644 --- a/includes/discovery/sensors/temperatures/hpblmos.inc.php +++ b/includes/discovery/sensors/temperatures/hpblmos.inc.php @@ -3,7 +3,6 @@ $sensor_type = 'hpblmos_temps'; $temps_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.5'; - //$sensor_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.5.'; $sensor_value_oid = '.1.3.6.1.4.1.232.22.2.3.1.2.1.6.'; $temps = trim(snmp_walk($device, $temps_oid, '-Osqn')); @@ -23,4 +22,4 @@ } } } -} \ No newline at end of file +} From 370fab065a808ea9d9ffb0a13160ac784ed9ac91 Mon Sep 17 00:00:00 2001 From: crcro Date: Tue, 16 Aug 2016 09:55:00 +0300 Subject: [PATCH 8/8] fix not set --- includes/discovery/sensors/power/hpblmos.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/sensors/power/hpblmos.inc.php b/includes/discovery/sensors/power/hpblmos.inc.php index 7067af91aecf..366244171d22 100644 --- a/includes/discovery/sensors/power/hpblmos.inc.php +++ b/includes/discovery/sensors/power/hpblmos.inc.php @@ -17,7 +17,7 @@ $current_id = $split_oid[(count($split_oid) - 1)]; $current_oid = $psu_usage_oid.$current_id; $psu_max_oid = $psu_max_usage_oid.$current_id; - $descr = 'PSU '.$psuid.' output'; + $descr = 'PSU '.$current_id.' output'; $value = snmp_get($device, $current_oid, '-Oqv'); $max_value = snmp_get($device, $psu_max_oid, '-Oqv'); discover_sensor($valid['sensor'], 'power', $device, $current_oid, $current_id, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value);