Module: check_mk
Branch: master
Commit: f24ae397b0d82ca258f3d6cc79f553fc736e602c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f24ae397b0d82c…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Apr 27 15:25:43 2017 +0200
4627 FIX apc_symmetra: Fix bogus 100000000 A battery current occurring on some devices
Some APC Symmetra devices react badly to OIDs being polled out of order, leading to
a 1000000000 A being displayed in the check that cannot be seen in an SNMP walk.
The OIDs of this check have been reordered to circumvent this problem.
Change-Id: I22622b01513f63190c1200350b03808fbd68a887
---
.werks/4627 | 13 +++++++++++++
checks/apc_symmetra | 8 +++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/4627 b/.werks/4627
new file mode 100644
index 0000000..eefffe7
--- /dev/null
+++ b/.werks/4627
@@ -0,0 +1,13 @@
+Title: apc_symmetra: Fix bogus 100000000 A battery current occurring on some devices
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1493298932
+
+Some APC Symmetra devices react badly to OIDs being polled out of order, leading to
+a 1000000000 A being displayed in the check that cannot be seen in an SNMP walk.
+The OIDs of this check have been reordered to circumvent this problem.
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index 8c86b17..4a1ef0b 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -67,9 +67,9 @@ def parse_apc_symmetra(info):
return parsed
# some numeric fields may be empty
- battery_status, output_status, state_output_state, battery_capacity,
\
+ battery_status, output_status, battery_capacity, \
battery_replace, battery_num_batt_packs, battery_time_remain, calib_result, \
- last_diag_date, battery_temp, battery_current = info[0]
+ last_diag_date, battery_temp, battery_current, state_output_state =
info[0]
if state_output_state != '':
# string contains a bitmask, convert to int
@@ -245,10 +245,11 @@ check_info['apc_symmetra'] = {
"inventory_function" : inventory_apc_symmetra,
"check_function" : check_apc_symmetra,
"service_description" : "APC Symmetra status",
+ # A Note on the order of OIDs: If the 11.1.1.0 is not the
last to be polled,
+ # this leads to bogus values for some other OIDs on some
devices.
"snmp_info" : (".1.3.6.1.4.1.318.1.1.1", [
"2.1.1.0", #
PowerNet-MIB::upsBasicBatteryStatus,
"4.1.1.0", #
PowerNet-MIB::upsBasicOutputStatus,
- "11.1.1.0", #
PowerNet-MIB::upsBasicStateOutputState
"2.2.1.0", #
PowerNet-MIB::upsAdvBatteryCapacity,
"2.2.4.0", #
PowerNet-MIB::upsAdvBatteryReplaceIndicator,
"2.2.6.0", #
PowerNet-MIB::upsAdvBatteryNumOfBadBattPacks,
@@ -257,6 +258,7 @@ check_info['apc_symmetra'] = {
"7.2.4.0", #
PowerNet-MIB::upsLastDiagnosticsDate
"2.2.2.0", #
PowerNet-MIB::upsAdvBatteryTemperature,
"2.2.9.0", #
PowerNet-MIB::upsAdvBatteryCurrent,
+ "11.1.1.0", #
PowerNet-MIB::upsBasicStateOutputState
]),
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.318.1.3"),
"has_perfdata" : True,