Module: check_mk
Branch: master
Commit: 37594718535dd7002b757a070b61b74a0f8f04a2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=37594718535dd7…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Nov 4 10:52:02 2013 +0100
brocade_mlx: added checks for overall status of the non empty modules
---
checks/brocade_mlx | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
index 576c8af..1db97d4 100644
--- a/checks/brocade_mlx
+++ b/checks/brocade_mlx
@@ -26,6 +26,7 @@
brocade_mlx_info = [ ('.1.3.6.1.4.1.1991.1.1.1.2.1.1', [ 1, 2, 3 ]), # power
supplies
('.1.3.6.1.4.1.1991.1.1.1.3.1.1', [ 1, 2, 3 ]), # fans
+ ('.1.3.6.1.4.1.1991.1.1.2.2.1.1', [ 1, 2, 12 ]), # modules
]
def brocade_mlx_scan(oid):
@@ -97,3 +98,35 @@ check_info["brocade_mlx.fan"] = {
"has_perfdata" : False,
}
+#############################################################################
+# Modules
+#############################################################################
+
+def inventory_brocade_mlx_module(info):
+ inventory = []
+ for module_id, module_descr, module_state in info[2]:
+ # do not inventorize modules reported as empty
+ if module_state != "0":
+ inventory.append( (combine_item(module_id, module_descr), None) )
+ return inventory
+
+def check_brocade_mlx_module(item, _no_params, info):
+ for module_id, module_descr, module_state in info[2]:
+ if combine_item(module_id, module_descr) == item:
+ if module_state == "10":
+ return 0, "Module reports status 10 (running)"
+ elif module_state == "0":
+ return 1, "Module reports status 0 (empty)"
+ else:
+ return 2, "Module reports status %s" % module_state
+ return 3, "Module %s not found" % item
+
+check_info["brocade_mlx.module"] = {
+ "check_function" : check_brocade_mlx_module,
+ "inventory_function" : inventory_brocade_mlx_module,
+ "service_description" : "Module %s",
+ "snmp_info" : brocade_mlx_info,
+ "snmp_scan_function" : brocade_mlx_scan,
+ "has_perfdata" : False,
+}
+