Module: check_mk
Branch: master
Commit: 8f552251ad3741d38909f47703051721be3eb3b5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f552251ad3741…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Mar 31 20:45:55 2014 +0200
cisco_wlc: Now supports clustered services. Thanks to Marcel Schulte and Udo Woehler
---
checks/cisco_wlc | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/checks/cisco_wlc b/checks/cisco_wlc
index 00b6c0f..6d0300c 100644
--- a/checks/cisco_wlc
+++ b/checks/cisco_wlc
@@ -29,8 +29,12 @@
def cisco_wlc_convert(info):
data = []
- for i in range(0, len(info[0])):
- data.append((info[0][i][1], info[1][i][1], info[2][i][1], info[3][i][1] ))
+
+ for j in range(0, len(info), 4):
+ for i in range(1, len(info[j])):
+ if len(info[j][i][1]) > 0:
+ data.append((info[j][i][1], info[j+1][i][1], info[j+2][i][1],
info[j+3][i][1], info[j][0] ))
+
return data
def inventory_cisco_wlc(info):
@@ -39,15 +43,22 @@ def inventory_cisco_wlc(info):
def check_cisco_wlc(item, params, info):
data = cisco_wlc_convert(info)
- for name, mac, state, model in data:
+ for name, mac, state, model, node in data:
if name == item:
+ if node == None:
+ node = ''
+ else:
+ node = ' (connected to %s)' % node
+
state = saveint(state)
+
if state == 1:
- return 0, "Accesspoint online"
+ return 0, "Accesspoint online" + node
if state == 3:
- return 1, "Accesspoint state Warning"
+ return 1, "Accesspoint state Warning" + node
if state == 2:
- return 2, "State Critical"
+ return 2, "State Critical" + node
+ return 3, "Unknown state (%s) " % state
# Special treatment if this device is missing
if params:
@@ -62,8 +73,8 @@ check_info["cisco_wlc"] = {
"inventory_function" : inventory_cisco_wlc,
"group" : "cisco_wlc",
"service_description" : "AP %s",
- "has_perfdata" : False,
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.2.1.1.2.0') in
[".1.3.6.1.4.1.9.1.1069"],
+ "node_info" : True,
+ "snmp_scan_function" : lambda oid: oid('.1.3.6.1.2.1.1.2.0') in
[".1.3.6.1.4.1.9.1.1069", ".1.3.6.1.4.1.14179.1.1.4.3"],
"snmp_info" : [( ".1.3.6.1.4.1.14179.2.2.1.1.3", [
OID_END, '' ]),
( ".1.3.6.1.4.1.14179.2.2.1.1.1", [ OID_END,
'' ]),
( ".1.3.6.1.4.1.14179.2.2.1.1.6", [ OID_END,
'' ]),