Module: check_mk
Branch: master
Commit: 355a05035b2003fdbe6166dedcd9dfee53e28ad5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=355a05035b2003…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Nov 4 16:09:20 2013 +0100
brocade_mlx: added checks for Temperature Sensors
---
checks/brocade_mlx | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 45 insertions(+), 5 deletions(-)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
index 469348e..f8bec7a 100644
--- a/checks/brocade_mlx
+++ b/checks/brocade_mlx
@@ -30,6 +30,7 @@ brocade_mlx_info = [ ('.1.3.6.1.4.1.1991.1.1.1.2.1.1', [ 1, 2, 3
]), # power sup
# modules (id, descr, overall status, MemoryTotal,
MemoryAvailable)
('.1.3.6.1.4.1.1991.1.1.2.11.1.1.5', [ OID_END, ""
]),
# modules (Rest of OId starting with module ID,
CpuUtilPercent)
+ ('.1.3.6.1.4.1.1991.1.1.2.13.1.1', [ 3, 4 ]), #
temperature sensors (descr, temperature)
]
def brocade_mlx_scan(oid):
@@ -39,7 +40,7 @@ def combine_item(id, descr):
if descr == "":
return id
else:
- return "%s: %s" % (id, descr)
+ return "%s %s" % (id, descr)
#############################################################################
# Power Supplies
@@ -124,10 +125,10 @@ def check_brocade_mlx_module(item, _no_params, info):
return 2, "Module reports status %s" % module_state
return 3, "Module %s not found" % item
-check_info["brocade_mlx.module"] = {
+check_info["brocade_mlx.module_status"] = {
"check_function" : check_brocade_mlx_module,
"inventory_function" : inventory_brocade_mlx_module,
- "service_description" : "Module %s Status",
+ "service_description" : "Line module %s Status",
"snmp_info" : brocade_mlx_info,
"snmp_scan_function" : brocade_mlx_scan,
"has_perfdata" : False,
@@ -179,7 +180,7 @@ def check_brocade_mlx_module_mem(item, params, info):
check_info["brocade_mlx.module_mem"] = {
"check_function" : check_brocade_mlx_module_mem,
"inventory_function" : inventory_brocade_mlx_module_mem,
- "service_description" : "Module %s Memory",
+ "service_description" : "Line module %s Memory",
"snmp_info" : brocade_mlx_info,
"snmp_scan_function" : brocade_mlx_scan,
"has_perfdata" : True,
@@ -246,9 +247,48 @@ def check_brocade_mlx_module_cpu(item, params, info):
check_info["brocade_mlx.module_cpu"] = {
"check_function" : check_brocade_mlx_module_cpu,
"inventory_function" : inventory_brocade_mlx_module_cpu,
- "service_description" : "Module %s CPU",
+ "service_description" : "Line module %s CPU",
"snmp_info" : brocade_mlx_info,
"snmp_scan_function" : brocade_mlx_scan,
"has_perfdata" : True,
}
+#############################################################################
+# Temperature Sensors
+#############################################################################
+
+brocade_mlx_temperature_default_levels = (100, 120)
+
+def inventory_brocade_mlx_temp(info):
+ inventory = []
+ for temp_descr, temp_value in info[4]:
+ inventory.append( (temp_descr,
"brocade_mlx_temperature_default_levels") )
+ return inventory
+
+def check_brocade_mlx_temp(item, params, info):
+ warn, crit = params
+ for temp_descr, temp_value in info[4]:
+ temp_value = saveint(temp_value)
+ if temp_descr == item:
+
+ status = 0
+ if temp_value > warn:
+ status = 1
+ if temp_value > crit:
+ status = 2
+
+ perfdata = [ ('temperature', str(temp_value) + '°C', warn,
crit, 0, '') ]
+
+ return status, "Temperature is %s°C" % temp_value, perfdata
+
+ return 3, "temp supply %s not found" % item
+
+check_info["brocade_mlx.temperature"] = {
+ "check_function" : check_brocade_mlx_temp,
+ "inventory_function" : inventory_brocade_mlx_temp,
+ "service_description" : "%s",
+ "snmp_info" : brocade_mlx_info,
+ "snmp_scan_function" : brocade_mlx_scan,
+ "has_perfdata" : False,
+}
+