Module: check_mk
Branch: master
Commit: 17ef25804eaf7f9153efbda8ab523140962786d5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17ef25804eaf7f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Aug 14 10:00:52 2014 +0200
tcp_conn_stats: Next try to fix the bugs since the last changes of the check
---
checks/tcp_conn_stats | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/checks/tcp_conn_stats b/checks/tcp_conn_stats
index 55fc841..70c86f5 100644
--- a/checks/tcp_conn_stats
+++ b/checks/tcp_conn_stats
@@ -47,10 +47,12 @@ def inventory_tcp_conn_stats(info):
def check_tcp_conn_stats(item, params, info):
stats = dict(info)
+ hit = False
for stat_state, hex in tcp_conn_stats_states:
num = int(stats.get(stat_state, stats.get(hex, 0)))
state = 0
if num > 0: # Only check positive counts
+ hit = True
infotext = "%s: %d" % (stat_state, num)
perf = [stat_state, num]
levels = params.get(stat_state)
@@ -64,9 +66,9 @@ def check_tcp_conn_stats(item, params, info):
elif num >= warn:
state = 1
infotext += " (warning at %d)" % warn
- else:
- infotext = None
- yield state, infotext, [perf]
+ yield state, infotext, [perf]
+ if not hit:
+ yield 0, "Currently no tcp connection stats"
check_info["tcp_conn_stats"] = {