Module: check_mk
Branch: master
Commit: 43d632d412fc6166ebb02690686d48f99cdaa705
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=43d632d412fc61…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 23 14:12:16 2016 +0200
3654 FIX apc_symmetra: Improved output in case of unknown battery state / calibration
result
---
.werks/3654 | 10 ++++++++++
ChangeLog | 1 +
checks/apc_symmetra | 11 +++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/3654 b/.werks/3654
new file mode 100644
index 0000000..d903c79
--- /dev/null
+++ b/.werks/3654
@@ -0,0 +1,10 @@
+Title: apc_symmetra: Improved output in case of unknown battery state / calibration
result
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1466683905
+
+
diff --git a/ChangeLog b/ChangeLog
index da35207..d6e3e3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -282,6 +282,7 @@
* 3549 FIX: netapp_api_snapshots: now correctly processes offline volumes...
* 3145 FIX: solaris agent: fileinfo patterns that match a directory will no longer
output items for the files in that directory...
* 3147 FIX: windows agent: fixed bug where all placeholders in messages were replaced
with the same parameter
+ * 3654 FIX: apc_symmetra: Improved output in case of unknown battery state /
calibration result
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index bbe3e23..cb40b4c 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -111,9 +111,16 @@ def check_apc(item, params, info):
12:"on smart trim" }
calib_text = { 1:"", 2:" (calibration invalid)", 3:"
(calibration in progress)" }
stest_text = self_test_in_progress and " (self-test running)" or
""
- infotxt = "output status: %s%s%s" % (status_text.get(output_status),
calib_text.get(calib_result), stest_text)
+
+ infotxt = "output status: %s%s%s" % \
+ (status_text.get(output_status, "unknown (%d)" %
output_status),
+ calib_text.get(calib_result, " (calibration unknown: %d)" %
calib_result),
+ stest_text)
+
# during calibration test is OK
- if output_status not in [2, 4, 12] and calib_result != 3 and not
self_test_in_progress:
+ if output_status not in status_text:
+ state = 3
+ elif output_status not in [2, 4, 12] and calib_result != 3 and not
self_test_in_progress:
state = 2
else:
state = 0