Module: check_mk
Branch: master
Commit: 5fd4bb5ef93ee3464347bbe7cb9f8fce07b7cb30
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fd4bb5ef93ee3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 25 16:46:18 2010 +0200
blade_blowers: Can handle responses without rpm values now. Improved output.
---
ChangeLog | 3 +++
checks/blade_blowers | 29 +++++++++++++++++++++--------
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c840190..3e6e9fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* megaraid_pdisks: Using the real enclosure number as check item now
* if/if64: Added expected interface speed to warning output
* wut_webtherm: handle more variants of WuT Webtherms (thanks to Lefty)
+ * blade_bays: Also inventorizes standby blades and has a little more
+ verbose output.
+ * blade_blowers: Can handle responses without rpm values now. Improved output.
Multisite:
* The custom open/close states of custom links are now stored for each
diff --git a/checks/blade_blowers b/checks/blade_blowers
index 81a89cd..b12fae2 100644
--- a/checks/blade_blowers
+++ b/checks/blade_blowers
@@ -69,19 +69,32 @@ def inventory_blade_blowers(checkname, info):
def check_blade_blowers(item, _no_params, info):
blower, num_blowers = map(int, item.split("/"))
text = info[blower-1][0]
+ perfdata = []
+ output = ''
+
+ state = info[blower-1 + num_blowers][0]
+
+ try:
+ rpm = int(info[blower-1 + 2*num_blowers][0])
+ perfdata += [("rpm", rpm)]
+ output += 'Speed at %d RMP' % rpm
+ except:
+ pass
+
try:
perc = int(text.split("%")[0])
+ perfdata += [("perc", perc, None, None, 0, 100)]
+ if output == '':
+ output += 'Speed is at %d%% of max' % perc
+ else:
+ output += ' (%d%% of max)' % perc
except:
- perc = 0
- state = info[blower-1 + num_blowers][0]
- rpm = int(info[blower-1 + 2*num_blowers][0])
- perfdata = [("perc", perc, None, None, 0, 100), ("rpm", rpm)]
- info = "- Speed at %d RPM (%d%% of max)" % (rpm, perc)
+ pass
+
if state == "1":
- return (0, "OK" + info, perfdata)
+ return (0, "OK - " + output, perfdata)
else:
- return (2, "CRIT" + info, perfdata)
-
+ return (2, "CRIT - " + output, perfdata)
check_info['blade_blowers'] = ( check_blade_blowers, "Blower %s", 1,
inventory_blade_blowers)