Module: check_mk
Branch: master
Commit: 70370d5fd63faaa0e23ca79b996b19a1abae68f0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70370d5fd63faa…
Author: Lutz Helwing <lh(a)mathias-kettner.de>
Date: Fri Jan 23 17:42:50 2015 +0100
repaired not working kemp_loadmaster_realserver check
---
checks/kemp_loadmaster_realserver | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/checks/kemp_loadmaster_realserver b/checks/kemp_loadmaster_realserver
index 98e144a..e035bb3 100644
--- a/checks/kemp_loadmaster_realserver
+++ b/checks/kemp_loadmaster_realserver
@@ -26,7 +26,8 @@
def inventory_kemp_loadmaster_realserver(info):
- return [ ( x[0], None ) for x in info ]
+ for line in info:
+ yield line[0], None
def check_kemp_loadmaster_realserver(item, _no_params, info):
states = { 1 : 'reachable',
@@ -41,21 +42,28 @@ def check_kemp_loadmaster_realserver(item, _no_params, info):
for line in info:
if line[0] == item:
state = int(line[1])
- message = "State: %s" % (states[state])
- if state == 1:
+ message = "State: %s, IP: %s" % (states[state], line[2])
+
+ if state in [ 1, 20 ]:
return 0, message
- if state == 6:
+ elif state in [ 2, 3, 4 ]:
return 1, message
- if state in [ 2, 3, 4, 5, 7, 20 ]:
+ elif state in [ 5, 6, 7 ]:
+ return 2, message
+ else:
return 3, message
+
return 3, "Service not found"
check_info["kemp_loadmaster_realserver"] = {
"check_function" : check_kemp_loadmaster_realserver,
"inventory_function" : inventory_kemp_loadmaster_realserver,
- "service_description" : "Server %s",
- "has_perfdata" : False,
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.12196.250.10",
- "snmp_info" : ( ".1.3.6.1.2.1.4.35.1.7.7.1.4", [
OID_END, ''] ),
+ "service_description" : "Real Server %s",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [ ".1.3.6.1.4.1.12196.250.10", ".1.3.6.1.4.1.2021.250.10" ],
+ "snmp_info" : ( ".1.3.6.1.4.1.12196.13.2.1", [
+ 2, # ip address: rSip
+ 5, # id: rSidx
+ 8, # state: rSstate
+ ] ),
}