Module: check_mk
Branch: master
Commit: 4e14f9e761d3c34d8dedbaec1318c5ccd8df5306
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4e14f9e761d3c3…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue May 31 14:22:22 2016 +0200
fixed params handling and cleanup
---
checks/websphere_mq_channels | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/checks/websphere_mq_channels b/checks/websphere_mq_channels
index a334973..893853d 100644
--- a/checks/websphere_mq_channels
+++ b/checks/websphere_mq_channels
@@ -34,8 +34,6 @@
# 0 CHANNEL(C000052.SV1348520.T1) 5000 RUNNING
# 0 CHANNEL(C000052.SV2098742.T1) 5000 Unknown
-# Anzahl_Message Channelname MaxMessages_Moeglich Status"
-
websphere_mq_channels_default_levels = {
'message_count': ( 900, 1000 ),
@@ -61,18 +59,24 @@ def check_websphere_mq_channels(item, params, info):
if channel == item:
messages = saveint(messages)
max_messages = saveint(max_messages)
+ infotext = "%d/%d messages" % (messages, max_messages)
state = 0
- warn, crit = params['message_count']
- if messages >= crit:
- state = 2
- elif messages >= warn:
- state = 1
- yield state, "%d/%d messages" % (messages, max_messages), \
- [('messages', messages, warn, crit, 0, max_messages)]
+ if params['message_count']:
+ warn, crit = params['message_count']
+ if messages >= crit:
+ state = 2
+ elif messages >= warn:
+ state = 1
+ if state:
+ infotext += " (warn crit at %d/%d messages)" % (warn,
crit)
+ else:
+ warn, crit = (None, None)
+
+ yield state, infotext, [('messages', messages, warn, crit, 0,
max_messages)]
state = params['status'].get(status,
params['status'].get('other', 2))
- yield state, "Channel State: %s" % status, []
+ yield state, "Channel status: %s" % status, []
check_info["websphere_mq_channels"] = {