Module: check_mk
Branch: master
Commit: 6fb81e6ddb02b291c985afac6db3972f3d8f0f6d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6fb81e6ddb02b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 9 12:00:33 2018 +0200
6062 FIX checkpoint_ha_status: Workaround devices reporting wrong state information
Some devices report a state of "Active\n" instead of "Active" which
was not
handled by the check. The state could not be determined correctly.
Change-Id: Ia5aeba84366a6c18ff588f1eafcc12d64486b350
---
.werks/6062 | 12 ++++++++++++
checks/checkpoint_ha_status | 3 +++
2 files changed, 15 insertions(+)
diff --git a/.werks/6062 b/.werks/6062
new file mode 100644
index 0000000..e96f9d5
--- /dev/null
+++ b/.werks/6062
@@ -0,0 +1,12 @@
+Title: checkpoint_ha_status: Workaround devices reporting wrong state information
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1525859977
+
+Some devices report a state of "Active\n" instead of "Active" which
was not
+handled by the check. The state could not be determined correctly.
diff --git a/checks/checkpoint_ha_status b/checks/checkpoint_ha_status
index 48e26d0..511c1ec 100644
--- a/checks/checkpoint_ha_status
+++ b/checks/checkpoint_ha_status
@@ -44,6 +44,9 @@ def inventory_checkpoint_ha_status(info):
def check_checkpoint_ha_status(_no_item, _no_params, info):
installed, major, minor, started, state, block_state, stat_code, stat_long = info[0]
+ # Some devices have a trailing "\n" in the state field. Drop it.
+ state = state.rstrip()
+
if installed == "0":
yield 2, "Not installed"
else: