Module: check_mk
Branch: master
Commit: 5305cc3c59a311230fd1fb9c8fad16f6fb2c4965
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5305cc3c59a311…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed May 15 15:41:23 2013 +0200
winperf_tcp_conn: now with performance data and checkman
---
checkman/winperf_tcp_conn | 19 +++++++++++++++++++
checks/winperf_tcp_conn | 5 ++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/checkman/winperf_tcp_conn b/checkman/winperf_tcp_conn
new file mode 100644
index 0000000..abed0d9
--- /dev/null
+++ b/checkman/winperf_tcp_conn
@@ -0,0 +1,19 @@
+title: Monitor number of TCP connections per state
+agents: windows
+author: Andreas Boesl (ab(a)mathias-kettner.de)
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the number of established TCP connections on windows systems
+
+perfdata:
+ The number of established connections
+
+inventory:
+ If the windows agents has the section <<<winperf_tcp_conn>>>, then one
check
+ will be created
+
+
+[parameters]
+levels(dict from string to (int, int)): A python dictionary with the key ESTABLISHED and
a pair of integers for warning and critical levels. If this state is not listed then the
check will be always OK
+
diff --git a/checks/winperf_tcp_conn b/checks/winperf_tcp_conn
index 7427666..14a9ce4 100644
--- a/checks/winperf_tcp_conn
+++ b/checks/winperf_tcp_conn
@@ -45,9 +45,11 @@ def check_winperf_tcp_conn(item, params, info):
]
infotext = ""
worst_state = 0
+ perfdata = []
for offset, name, param_key in fields:
value = saveint(info[offset][1])
infotext += "%s: %s" % (name, value)
+ warn, crit = "", ""
if params.get(param_key):
warn, crit = params.get(param_key)
if value >= crit:
@@ -57,9 +59,10 @@ def check_winperf_tcp_conn(item, params, info):
worst_state = max(1, worst_state)
infotext += "(!) (warning at %d)" % warn
infotext += ", "
+ perfdata.append( (name, value, warn, crit) )
infotext = infotext[:-2]
- return (worst_state, infotext)
+ return worst_state, infotext, perfdata
check_info["winperf_tcp_conn"] = {
'check_function': check_winperf_tcp_conn,