Module: check_mk
Branch: master
Commit: a1e87652834b12348bef9a092775f208da6d8cb8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a1e87652834b12…
Author: Lutz Helwing <lh(a)mathias-kettner.de>
Date: Mon Jan 26 11:12:21 2015 +0100
fixed info line indices and added some comments
---
checks/kemp_loadmaster_realserver | 44 +++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 17 deletions(-)
diff --git a/checks/kemp_loadmaster_realserver b/checks/kemp_loadmaster_realserver
index e035bb3..9e95923 100644
--- a/checks/kemp_loadmaster_realserver
+++ b/checks/kemp_loadmaster_realserver
@@ -24,25 +24,32 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# example for contents of info:
+# IP address id state
+# ['10.20.30.101', '1', '1'],
+# ['10.20.30.102', '2', '1'],
+# ['10.20.30.101', '3', '1'],
+# ['10.20.30.102', '4', '1'],
+# ['10.20.30.101', '5', '1'],
+# ['10.20.30.102', '6', '1']
def inventory_kemp_loadmaster_realserver(info):
for line in info:
- yield line[0], None
+ yield line[1], None
def check_kemp_loadmaster_realserver(item, _no_params, info):
- states = { 1 : 'reachable',
- 2 : 'stale',
- 3 : 'delay',
- 4 : 'probe',
- 5 : 'invalid',
- 6 : 'unkown',
- 7 : 'incomplete',
- 20 : 'not in use'}
+ # states as they are defined in corresponding MIB: B100-MIB::rSstate
+ states = {
+ 1 : 'in service',
+ 2 : 'out of service',
+ 3 : 'failed',
+ 4 : 'disabled'
+ }
for line in info:
- if line[0] == item:
- state = int(line[1])
- message = "State: %s, IP: %s" % (states[state], line[2])
+ if line[1] == item:
+ state = int(line[2])
+ message = "State: %s, IP: %s" % (states[state], line[0])
if state in [ 1, 20 ]:
return 0, message
@@ -59,11 +66,14 @@ check_info["kemp_loadmaster_realserver"] = {
"check_function" : check_kemp_loadmaster_realserver,
"inventory_function" : inventory_kemp_loadmaster_realserver,
"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_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
- ] ),
+ 2, # ip address: B100-MIB::rSip
+ 5, # id: B100-MIB::rSidx
+ 8, # state: B100-MIB::rSstate
+ ] ),
}