Module: check_mk
Branch: master
Commit: 103a83b19afd48ead47bc07874ec0f7932293311
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=103a83b19afd48…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Nov 8 14:11:31 2013 +0100
brocade_mlx: improved checks with informations from the MIB
---
checkman/brocade_mlx.module_status | 6 ++++--
checkman/brocade_mlx.temperature | 8 ++++----
checks/brocade_mlx | 21 +++++++++++++++------
3 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/checkman/brocade_mlx.module_status b/checkman/brocade_mlx.module_status
index 1d97598..8bd537e 100644
--- a/checkman/brocade_mlx.module_status
+++ b/checkman/brocade_mlx.module_status
@@ -7,8 +7,10 @@ description:
Checks the overall status of modules in Brocade NetIron MLX
switching / routing devices.
- Returns {OK} on status 10 (running), {WARN} on status 0 (empty)
- and {CRIT} on every other status.
+ Returns {OK} on status 10 (running).
+ Returns {WARN} on status 0 (empty), 2 (going down) and 9 (coming up).
+ Returns {CRIT} on status 3 (rejected) and 4 (bad).
+ Returns {UNKN} on every other status.
item:
If a module description is delivered by SNMP, the item is build from the
diff --git a/checkman/brocade_mlx.temperature b/checkman/brocade_mlx.temperature
index 0502d6d..113e389 100644
--- a/checkman/brocade_mlx.temperature
+++ b/checkman/brocade_mlx.temperature
@@ -14,8 +14,8 @@ item:
The description of the temperature sensor as provided by SNMP.
examples:
- # set default levels to 70°C and 80°C:
- brocade_mlx_temperature_default_levels = (70, 80)
+ # set default levels to 30°C and 40°C:
+ brocade_mlx_temperature_default_levels = (30, 40)
# Check a sensor with description Switch Fabric module 0, sensor 1 temperature
# on a box called my-mlx-device with default levels
@@ -25,7 +25,7 @@ examples:
# or use individual levels for warn and crit
checks += [
- ("my-mlx-device", "brocade_mlx.temperature", 'Switch Fabric
module 0, sensor 1 temperature', (80, 100)
+ ("my-mlx-device", "brocade_mlx.temperature", 'Switch Fabric
module 0, sensor 1 temperature', (40, 50)
]
perfdata:
@@ -40,4 +40,4 @@ crit(int): {CRIT} state is triggered, if the temperature is higher than
this.
[configuration]
brocade_mlx_temperature_default_levels(int, int): The standard levels for {WARN}
- and {CRIT}. Defaults are (100, 120)
+ and {CRIT}. Defaults are (50, 60)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
index 2a042f8..9eb14b3 100644
--- a/checks/brocade_mlx
+++ b/checks/brocade_mlx
@@ -117,12 +117,20 @@ def inventory_brocade_mlx_module(info):
def check_brocade_mlx_module(item, _no_params, info):
for module_id, module_descr, module_state, mem_total, mem_avail 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":
+ if module_state == "0":
return 1, "Module reports status 0 (empty)"
+ elif module_state == "2":
+ return 1, "Module reports status 2 (going down)"
+ elif module_state == "3":
+ return 2, "Module reports status 3 (rejected)"
+ elif module_state == "4":
+ return 2, "Module reports status 4 (bad)"
+ elif module_state == "9":
+ return 1, "Module reports status 9 (coming up)"
+ elif module_state == "10":
+ return 0, "Module reports status 10 (running)"
else:
- return 2, "Module reports status %s" % module_state
+ return 3, "Module reports unidentified status %s" %
module_state
return 3, "Module %s not found" % item
check_info["brocade_mlx.module_status"] = {
@@ -262,7 +270,7 @@ check_info["brocade_mlx.module_cpu"] = {
# Temperature Sensors
#############################################################################
-brocade_mlx_temperature_default_levels = (100, 120)
+brocade_mlx_temperature_default_levels = (50, 60)
def inventory_brocade_mlx_temp(info):
inventory = []
@@ -273,7 +281,8 @@ def inventory_brocade_mlx_temp(info):
def check_brocade_mlx_temp(item, params, info):
warn, crit = params
for temp_descr, temp_value in info[4]:
- temp_value = saveint(temp_value)
+ # Info from the MIB: "Each unit is 0.5 degrees Celcius."
+ temp_value = int(saveint(temp_value) / 2)
if temp_descr == item:
status = 0