Module: check_mk
Branch: master
Commit: 7d8bd4ccf616102b2ac8a731e8ce44296db75d38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d8bd4ccf61610…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 25 17:12:17 2010 +0200
cisco_fan: Does not inentorize notPresent sensors anymore. Imporved output.
---
ChangeLog | 1 +
checks/cisco_fan | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3e6e9fc..5a8ab9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
* blade_bays: Also inventorizes standby blades and has a little more
verbose output.
* blade_blowers: Can handle responses without rpm values now. Improved output.
+ * cisco_fan: Does not inentorize 'notPresent' sensors anymore. Imporved
output.
Multisite:
* The custom open/close states of custom links are now stored for each
diff --git a/checks/cisco_fan b/checks/cisco_fan
index 48adbec..04f824c 100644
--- a/checks/cisco_fan
+++ b/checks/cisco_fan
@@ -24,17 +24,22 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+cisco_fan_states = ('', 'normal', 'warning', 'critical',
+ 'shutdown', 'notPresent',
'notFunctioning')
def inventory_cisco_fan(checkname, info):
- return [ (line[0], None) for line in info ]
+ return [ (line[0], None) for line in info if line[1] != '5' ]
def check_cisco_fan(item, params, info):
for line in info:
if line[0] == item:
- if line[1] == "1":
- return (0, "OK")
+ state = saveint(line[1])
+ if state == 1:
+ return (0, "OK (State is: %s (%d))" % (cisco_fan_states[state],
state))
+ elif state == 2:
+ return (1, "WARNING (state is %s (%d))" %
(cisco_fan_states[state], state))
else:
- return (2, "CRITICAL (state is %ds" % line[1])
+ return (2, "CRITICAL (state is %s (%d))" %
(cisco_fan_states[state], state))
return (3, "UNKNOWN - item not found in snmp data")
check_info['cisco_fan'] = (check_cisco_fan, "FAN %s", 0,
inventory_cisco_fan)