Module: check_mk
Branch: master
Commit: 283af3df70742579d4b75fc10822b9107ec89a16
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=283af3df707425…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Aug 29 11:25:08 2014 +0200
tcp_conn_stats: fix missing performance values
---
checks/tcp_conn_stats | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/checks/tcp_conn_stats b/checks/tcp_conn_stats
index cb0b49a..a3c2b92 100644
--- a/checks/tcp_conn_stats
+++ b/checks/tcp_conn_stats
@@ -51,10 +51,10 @@ def check_tcp_conn_stats(item, params, info):
for stat_state, hex in tcp_conn_stats_states:
num = int(stats.get(stat_state, stats.get(hex, 0)))
state = 0
+ perf = [stat_state, num]
if num > 0: # Only check positive counts
hit = True
infotext = "%s: %d" % (stat_state, num)
- perf = [stat_state, num]
levels = params.get(stat_state)
if levels:
warn, crit = levels
@@ -66,9 +66,12 @@ def check_tcp_conn_stats(item, params, info):
elif num >= warn:
state = 1
infotext += " (warning at %d)" % warn
- yield state, infotext, [perf]
+ yield state, infotext, [ tuple(perf) ]
+ else:
+ yield 0, None, [ tuple(perf) ]
+
if not hit:
- yield 0, "Currently no tcp connection stats"
+ yield 0, "Currently no TCP connections"
check_info["tcp_conn_stats"] = {