[checkmk-commits] Check_MK Git: check_mk: checkpoint_connections: More code cleanup

Bastian Kuhn bk at mathias-kettner.de
Mon Feb 16 11:24:22 CET 2015


Module: check_mk
Branch: master
Commit: 690832f484c81b7ab85d610d82f58541de8fe5c2
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=690832f484c81b7ab85d610d82f58541de8fe5c2

Author: Bastian Kuhn <bk at mathias-kettner.de>
Date:   Mon Feb 16 11:24:08 2015 +0100

checkpoint_connections: More code cleanup

---

 checks/checkpoint_connections |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/checks/checkpoint_connections b/checks/checkpoint_connections
index e90ceb0..1292385 100644
--- a/checks/checkpoint_connections
+++ b/checks/checkpoint_connections
@@ -34,17 +34,19 @@ def inventory_checkpoint_connections(info):
 
 def check_checkpoint_connections(item, params, info):
     warn, crit = params
-    current = saveint(info[0][0])
+    current = int(info[0][0])
     state = 0
-    icon = ''
+    levels = " (levels at %d/%d)" % (warn, crit)
+    infotext = "%d Current Connections" % (current)
     if current >= warn:
         state = 1
+        infotext += levels
     if current >= crit:
         state = 2
+        infotext += levels
 
     perfdata = [("connections", current, warn, crit)]
-    infotext = "%d Current Connections (levels at %d/%d)" % (current, warn, crit)
-    yield state, infotext, perfdata
+    return state, infotext, perfdata
 
 check_info["checkpoint_connections"] = {
     "check_function"        : check_checkpoint_connections,



More information about the checkmk-commits mailing list