Module: check_mk
Branch: master
Commit: 6a67f591f4e1a040a6d8c681dc376304ff6f7551
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a67f591f4e1a0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Aug 5 07:54:00 2016 +0200
added more readable alarm states to ispro check
---
checks/ispro_sensors_digital | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/checks/ispro_sensors_digital b/checks/ispro_sensors_digital
index afab12b..496dceb 100644
--- a/checks/ispro_sensors_digital
+++ b/checks/ispro_sensors_digital
@@ -36,24 +36,23 @@ def inventory_ispro_sensors_digital(info):
def check_ispro_sensors_digital(item, params, info):
map_states = {
- "state" : {
- "1" : "disabled",
- "2" : "normal open",
- "3" : "normal close",
+ "state" : { "1" : "disabled",
+ "2" : "normal open",
+ "3" : "normal close",
},
- "alarm" :{
- "1" : (0, "active"),
- "2" : (2, "inactive"),
+ "alarm" : { "1" : (0, "normal",
"active"),
+ "2" : (2, "alarm", "inactive"),
}
}
for name, alarm, state in info:
if item == name:
- alarm_state, alarm_state_readable = \
- map_states["alarm"].get(alarm, (3, "unexpected(%s)" %
alarm))
- return alarm_state, 'Status: %s, Alarm: %s' % \
+ # more readable, avoiding confusion
+ alarm_state, alarm_state_readable, alarm_device_state_readable = \
+ map_states["alarm"].get(alarm, (3, "unknown",
"unexpected(%s)" % alarm))
+ return alarm_state, 'Status: %s, Alarm status: %s (device: %s)' % \
(map_states["state"].get(state, "unexpected(%s)" %
state),
- alarm_state_readable)
+ alarm_state_readable, alarm_device_state_readable )
check_info['ispro_sensors_digital'] = {