Module: check_mk
Branch: master
Commit: 79dee8f87e31d9aa8f840d10ed4d5283df916546
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79dee8f87e31d9…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Feb 24 10:46:26 2017 +0100
8756 FIX didactum.include: added missing states and improved status handling
Change-Id: I1c4e4f2e4bd963d6ebb3777e16e17648358b2cc9
---
.werks/8756 | 11 +++++++++++
checks/didactum.include | 13 +++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/.werks/8756 b/.werks/8756
new file mode 100644
index 0000000..f61d717
--- /dev/null
+++ b/.werks/8756
@@ -0,0 +1,11 @@
+Title: didactum.include: added missing states and improved status handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487929535
+
+
diff --git a/checks/didactum.include b/checks/didactum.include
index 7732215..2ea0ad2 100644
--- a/checks/didactum.include
+++ b/checks/didactum.include
@@ -35,7 +35,9 @@ def scan_didactum(oid):
def parse_didactum_sensors(info):
map_states = {
"alarm" : 2,
+ "high alarm" : 2,
"warning" : 1,
+ "high warning" : 1,
"normal" : 0,
"not connected" : 3,
"on" : 0,
@@ -55,9 +57,16 @@ def parse_didactum_sensors(info):
except:
value = value_str
+ if status in map_states:
+ state = map_states[status]
+ state_readable = status
+ else:
+ state = 3
+ state_readable = "unknown[%s]" % status
+
parsed[ty].setdefault(name, {
- "state" : map_states.get(status, 3),
- "state_readable" : status,
+ "state" : state,
+ "state_readable" : state_readable,
"value" : value,
})