-
Notifications
You must be signed in to change notification settings - Fork 0
/
IBM_MQ_check
61 lines (52 loc) · 1.96 KB
/
IBM_MQ_check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2013 [email protected] |
# +------------------------------------------------------------------+
#
# Modified by to show only MQ_check
# we only care about MQ_check
#ISSSS.TO.ECSTEST:0:200
#MWICHAN:0:999999999
#RL101367.TO.ECSTEST:0:400
MQ_check_default_levels = (5, 10)
def inventory_MQ_Connections(info):
if len(info) == 1 and len(info[0]) >= 1:
return [(None, "kernel_util_default_levels")]
def check_MQ_Connections(_no_item, params, info):
#print info
MQ_check = int(info[0][0])
perfdata = [
('MQ_check', "%d" % MQ_check )
]
infotext = " - MQ_check: %2.1f%%" % (MQ_check)
# You may set a warning/critical level on the io wait
# percentage. This can be done by setting params to
# a pair of (warn, crit)
result = 0
try:
warn, crit = params
if MQ_check >= crit:
result = 2
infotext += "(!!)"
elif MQ_check >= warn:
result = 1
infotext += "(!)"
except:
pass
#print perfdata
return (result, nagios_state_names[result] + infotext, perfdata)
#,perfdata
check_info['MQ_check'] = {
"check_function" : check_MQ_Connections,
"inventory_function" : inventory_MQ_Connections,
"service_description" : "MQ Server Connections",
"has_perfdata" : True,
"group" : "cpu_iowait",
}