Module: check_mk
Branch: master
Commit: b39320a23c5a97b7bfdbefbaf11696887808ad50
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b39320a23c5a97…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Jan 8 09:41:46 2016 +0100
minor cleanup in checkpoint_connections check
---
checks/checkpoint_connections | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/checks/checkpoint_connections b/checks/checkpoint_connections
index c97d47b..cbc29d1 100644
--- a/checks/checkpoint_connections
+++ b/checks/checkpoint_connections
@@ -33,20 +33,20 @@ def inventory_checkpoint_connections(info):
return [(None, "checkpoint_connections_default_levels")]
def check_checkpoint_connections(item, params, info):
- warn, crit = params
- current = int(info[0][0])
+ connections = int(info[0][0])
state = 0
- levels = " (warn/crit at %d/%d)" % (warn, crit)
- infotext = "%d Current Connections" % (current)
- if current >= warn:
- state = 1
- infotext += levels
- if current >= crit:
+ infotext = "%d current connections" % (connections)
+ warn, crit = params
+
+ if connections >= crit:
state = 2
- infotext += levels
+ elif connections >= warn:
+ state = 1
+
+ if state > 0:
+ infotext += " (warn/crit at %d/%d)" % (warn, crit)
- perfdata = [("connections", current, warn, crit)]
- return state, infotext, perfdata
+ return state, infotext, [("connections", connections, warn, crit)]
check_info["checkpoint_connections"] = {
"check_function" : check_checkpoint_connections,