Module: check_mk
Branch: master
Commit: 015db5f7b4c2334b0915413e090764c732edc718
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=015db5f7b4c233…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Oct 4 13:56:20 2017 +0200
5316 FIX cmciii.access: Fixed error state handling
If status is 'Closed' Check_MK reports OK,
if it is 'Open' check goes WARN, otherwise CRIT.
Change-Id: I6fce67eac1651b6abf379c0d3eeea73cf255f976
---
.werks/5316 | 12 ++++++++++++
checkman/cmciii.access | 4 ++--
checks/cmciii | 2 ++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/5316 b/.werks/5316
new file mode 100644
index 0000000..eeb8500
--- /dev/null
+++ b/.werks/5316
@@ -0,0 +1,12 @@
+Title: cmciii.access: Fixed error state handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1507118033
+
+If status is 'Closed' Check_MK reports OK,
+if it is 'Open' check goes WARN, otherwise CRIT.
diff --git a/checkman/cmciii.access b/checkman/cmciii.access
index 434c1c6..7229099 100644
--- a/checkman/cmciii.access
+++ b/checkman/cmciii.access
@@ -9,8 +9,8 @@ description:
No limits are set in the check, since limits are configured in the
Rittal device itself. The state given by the Rittal device is
taken as the state of the check as follows:
- If the Rittal device returns {Closed}, the check is {OK}. Otherwise
- the check is {CRIT}.
+ If the Rittal device returns {Closed}, the check is {OK}, if it is
+ {Open} Check_MK reports WARN, otherwise {CRIT}.
item:
None
diff --git a/checks/cmciii b/checks/cmciii
index 2ef8ef6..db6adea 100644
--- a/checks/cmciii
+++ b/checks/cmciii
@@ -436,6 +436,8 @@ def check_cmciii_access(item, params, parsed):
if state_readable == "Closed":
state = 0
+ elif state_readable == "Open":
+ state = 1
else:
state = 2