Module: check_mk
Branch: master
Commit: 01eda1125c9f5d37804dbed9e110ad8418c07b30
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01eda1125c9f5d…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Jun 10 15:56:50 2011 +0200
updates
---
checkman/f5_bigip_temp | 2 +-
checks/f5_bigip_temp | 25 +++++++++++++++----------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/checkman/f5_bigip_temp b/checkman/f5_bigip_temp
index 62805f9..0a401d3 100644
--- a/checkman/f5_bigip_temp
+++ b/checkman/f5_bigip_temp
@@ -18,4 +18,4 @@ inventory:
perfdata:
- the check does not (yet) generate performance data.
+ It generates performance data for the current, warning and critical temperaturs and
graphs those.
diff --git a/checks/f5_bigip_temp b/checks/f5_bigip_temp
index 48c21fb..9579384 100644
--- a/checks/f5_bigip_temp
+++ b/checks/f5_bigip_temp
@@ -61,7 +61,7 @@ def f5_bigip_temp_genitem(info):
def inventory_f5_bigip_temp(checkname, info):
inventory = []
for sensor in f5_bigip_temp_genitem(info):
- inventory.append([sensor[0], nom_temp])
+ inventory.append([sensor[0], sensor[2]])
return inventory
@@ -70,14 +70,19 @@ def check_f5_bigip_temp(item, params, info):
for sensor in f5_bigip_temp_genitem(info):
if item == sensor[0]:
- tmpdiff = sensor[1] - sensor[2]
- msgtxt = " - Temperature is %dC" % (sensor[1])
- if 5 >= tmpdiff:
- return (0, "OK" + msgtxt)
- elif tmpdiff > 15:
- return (2, "CRIT" + msgtxt + "!!")
- elif tmpdiff > 10:
- return (1, "WARN" + msgtxt + "!")
+ cur_temp = sensor[1]
+ nom_temp = sensor[2]
+ # allow some increase in temperature to avoid false alarms
+ warn = nom_temp + 9
+ crit = nom_temp + 18
+ msgtxt = " - Temperature is %dC, Levels at %d/%d" % (cur_temp,
warn, crit)
+ perfdata = [ ("temp", cur_temp, warn, crit) ]
+ if warn >= cur_temp:
+ return (0, "OK" + msgtxt, perfdata)
+ elif crit <= cur_temp:
+ return (2, "CRIT" + msgtxt + "!!", perfdata)
+ elif warn < cur_temp:
+ return (1, "WARN" + msgtxt + "!", perfdata)
else:
return (3, "UNKNOWN - unable to read Temperature")
@@ -91,7 +96,7 @@ snmp_info["f5_bigip_temp"] = \
( ".1.3.6.1.4.1.3375.2.1.3.1.2.1", [ 1, 2 ]), ]
-check_info["f5_bigip_temp"] = (check_f5_bigip_temp, "TEMP %s", 0,
inventory_f5_bigip_temp )
+check_info["f5_bigip_temp"] = (check_f5_bigip_temp, "TEMP %s", 1,
inventory_f5_bigip_temp )
# Get ID and Speed from the CPU and chassis fan tables