Module: check_mk
Branch: master
Commit: ee2f6284439a95566b743945ab4b551caeb5000d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee2f6284439a95…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 25 12:15:15 2017 +0100
4301 FIX winperf_tcp_conn: fixed missing data handling
Change-Id: I8232d9773ba242d508c2c9c5d21b92bc7aa949f6
---
.werks/4301 | 10 ++++++++++
ChangeLog | 1 +
checks/winperf_tcp_conn | 10 +++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/4301 b/.werks/4301
new file mode 100644
index 0000000..01c24b1
--- /dev/null
+++ b/.werks/4301
@@ -0,0 +1,10 @@
+Title: winperf_tcp_conn: fixed missing data handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1485342878
+
+
diff --git a/ChangeLog b/ChangeLog
index 514b0fc..63bdde2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@
* 4298 FIX: omd_apache: fixed missing data handling
* 4299 FIX: df: fixed missing filesystem type handling
* 4300 FIX: job: fixed missing information handling
+ * 4301 FIX: winperf_tcp_conn: fixed missing data handling
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/winperf_tcp_conn b/checks/winperf_tcp_conn
index 287e2c7..1d8e425 100644
--- a/checks/winperf_tcp_conn
+++ b/checks/winperf_tcp_conn
@@ -24,6 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
# Example output from agent:
# <<<winperf_tcp_conn>>>
# 1368619819.06 638
@@ -36,10 +37,16 @@
# 14 34830 counter
# 16 18437 counter
+
def inventory_winperf_tcp_conn(info):
- return [ (None, {}) ]
+ if len(info) > 1:
+ return [ (None, {}) ]
+
def check_winperf_tcp_conn(item, params, info):
+ if len(info) == 1:
+ raise MKCounterWrapped("Got no information from agent")
+
fields = [
( 2, "Established", "ESTABLISHED" ),
]
@@ -64,6 +71,7 @@ def check_winperf_tcp_conn(item, params, info):
infotext = infotext[:-2]
return worst_state, infotext, perfdata
+
check_info["winperf_tcp_conn"] = {
'check_function': check_winperf_tcp_conn,
'inventory_function': inventory_winperf_tcp_conn,