Module: check_mk
Branch: master
Commit: 1c8d9035a41a09bbcbab1aaf0a3308db8d833bbe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c8d9035a41a09…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jun 4 18:28:02 2014 +0200
FIX brocade.fan, brocade.power, brocade.temp: will now only discover services which are
not marked as absent
---
.werks/616 | 8 ++++++++
ChangeLog | 1 +
checkman/brocade.fan | 7 +++++--
checkman/brocade.power | 5 +++--
checkman/brocade.temp | 6 ++++--
checks/brocade | 34 +++++++++++++++++++---------------
6 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/.werks/616 b/.werks/616
new file mode 100644
index 0000000..9f4e57e
--- /dev/null
+++ b/.werks/616
@@ -0,0 +1,8 @@
+Title: brocade.fan, brocade.power, brocade.temp: will now only discover services which
are not marked as absent
+Level: 1
+Component: checks
+Version: 1.2.5i4
+Date: 1401899225
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 38c6775..017021e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.5i4:
Checks & Agents:
* 0812 nginx_status: New check for monitoring status information of the Nginx web
server...
+ * 0616 FIX: brocade.fan, brocade.power, brocade.temp: will now only discover services
which are not marked as absent
Multisite:
* 0934 FIX: Logwatch messages with class unknown ( 'u' ) now displayed as
WARN...
diff --git a/checkman/brocade.fan b/checkman/brocade.fan
index ff00cd3..fde800a 100644
--- a/checkman/brocade.fan
+++ b/checkman/brocade.fan
@@ -7,13 +7,16 @@ description:
This checks monitors the FAN speeds of a Brocade FC switch.
item:
- The number of the FAN (1, 2, 3 ...) like descripted in the SNMP output.
+ The number of the FAN (1, 2, 3 ...) as described in the SNMP output.
perfdata:
The speed of each fan.
inventory:
- The inventory creates a service for each fan.
+
+ The inventory creates a service for each fan unless it is marked as absent
+ in {swSensorStatus}
+
[parameters]
warn(int): the minimum fan speed for an OK state
diff --git a/checkman/brocade.power b/checkman/brocade.power
index 7ee7a5f..a597899 100644
--- a/checkman/brocade.power
+++ b/checkman/brocade.power
@@ -8,8 +8,9 @@ description:
a Brocade switch.
item:
- The number of the power supply (1, 2, 3 ...) like descripted in the SNMP output.
+ The number of the power supply (1, 2, 3 ...) as described in the SNMP output.
inventory:
- The inventory creates a service for each power supply.
+ The inventory creates a service for each power supply unless it is marked as absent
+ in {swSensorStatus}
diff --git a/checkman/brocade.temp b/checkman/brocade.temp
index 221d3b9..7eaf931 100644
--- a/checkman/brocade.temp
+++ b/checkman/brocade.temp
@@ -7,13 +7,15 @@ description:
This checks monitors the hardware temperatures of a Brocade FC switch.
item:
- The Number of the sensor (1, 2, 3 ...) like descripted in the SNMP output.
+ The number of the sensor (1, 2, 3 ...) as described in the SNMP output.
perfdata:
The current temperature value for each sensor
inventory:
- The inventory creates a service for each sensor.
+ The inventory creates a service for each sensor unless it is marked as absent
+ in {swSensorStatus}
+
[parameters]
warn(int): the temperature at which a WARN state is reached
diff --git a/checks/brocade b/checks/brocade
index f455019..989b511 100644
--- a/checks/brocade
+++ b/checks/brocade
@@ -36,8 +36,8 @@
def brocade_sensor_convert(info, what):
return_list = []
- for state, name in info:
- if name.startswith(what) and (saveint(state) > 0 or what ==
"Power"):
+ for presence, state, name in info:
+ if name.startswith(what) and presence != "6" and (saveint(state) > 0
or what == "Power"):
sensor_id = name.split('#')[-1]
return_list.append([sensor_id, name, state])
return return_list
@@ -47,16 +47,20 @@ def brocade_scan(oid):
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.24.1.1588.2.1.1") or \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1588.2.2.1")
-brocade_info = ('.1.3.6.1.4.1.1588.2.1.1.1.1.22.1', [ 4, 5 ])
+brocade_info = ('.1.3.6.1.4.1.1588.2.1.1.1.1.22.1', [
+ 3, # swSensorStatus, 6 = absent
+ 4, # swSensorValue, -2147483648 = unknown
+ 5, # swSensorInfo
+ ])
brocade_fan_default_levels = { "lower": (3000 , 2800 ) }
def inventory_brocade_fan(info):
- info = brocade_sensor_convert(info, "FAN")
- return [ (x[0], 'brocade_fan_default_levels') for x in info ]
+ converted = brocade_sensor_convert(info, "FAN")
+ return [ (x[0], 'brocade_fan_default_levels') for x in converted ]
def check_brocade_fan(item, params, info):
- info = brocade_sensor_convert(info, "FAN")
+ converted = brocade_sensor_convert(info, "FAN")
if type(params) is tuple: # old format
warn, crit = params
else: # new format
@@ -66,7 +70,7 @@ def check_brocade_fan(item, params, info):
else:
upperwarn, uppercrit = ( None, None )
- for snmp_item, name, value in info:
+ for snmp_item, name, value in converted:
if item == snmp_item:
state = 0
label = ""
@@ -98,12 +102,12 @@ check_info["brocade.fan"] = {
}
def inventory_brocade_power(info):
- info = brocade_sensor_convert(info, "Power")
- return [ (x[0], None) for x in info ]
+ converted = brocade_sensor_convert(info, "Power")
+ return [ (x[0], None) for x in converted ]
def check_brocade_power(item, _no_params, info):
- info = brocade_sensor_convert(info, "Power")
- for snmp_item, name, value in info:
+ converted = brocade_sensor_convert(info, "Power")
+ for snmp_item, name, value in converted:
if item == snmp_item:
value = saveint(value)
if value != 1:
@@ -124,13 +128,13 @@ check_info["brocade.power"] = {
brocade_temp_default_levels = ( 30, 40 )
def inventory_brocade_temp(info):
- info = brocade_sensor_convert(info, "SLOT")
- return [ (x[0], 'brocade_temp_default_levels') for x in info ]
+ converted = brocade_sensor_convert(info, "SLOT")
+ return [ (x[0], 'brocade_temp_default_levels') for x in converted ]
def check_brocade_temp(item, params, info):
- info = brocade_sensor_convert(info, "SLOT")
+ converted = brocade_sensor_convert(info, "SLOT")
warn, crit = params
- for snmp_item, name, value in info:
+ for snmp_item, name, value in converted:
if item == snmp_item:
state = 0
label = ""