Module: check_mk
Branch: master
Commit: d6f40daac0e5da4e8ac06554776ca778cd703355
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6f40daac0e5da…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Tue Jul 12 13:59:57 2011 +0200
Code cleanup
---
checks/f5_bigip_temp | 35 +++++++++++++++--------------------
web/plugins/perfometer/check_mk.py | 4 ----
2 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/checks/f5_bigip_temp b/checks/f5_bigip_temp
index 91ef6d1..48c21fb 100644
--- a/checks/f5_bigip_temp
+++ b/checks/f5_bigip_temp
@@ -41,7 +41,7 @@
def f5_bigip_temp_genitem(info):
sensors = []
# parse all detected sensors and name them according to the mib section they came
from.
- # we will assign a base "nominal" temperature here based on sample MIB
data
+ # we will assign a base "nominal" temperature here based on sample MIB data
for chassis_sensor in info[0]:
id = chassis_sensor[0]
type = "Chassis"
@@ -54,14 +54,14 @@ def f5_bigip_temp_genitem(info):
cur_temp = int(cpu_sensor[1])
nom_temp = 55
sensors.append([ ("%s %s" % (id, type)), cur_temp, nom_temp ])
-
+
return sensors
def inventory_f5_bigip_temp(checkname, info):
inventory = []
for sensor in f5_bigip_temp_genitem(info):
- inventory.append([sensor[0], sensor[2]])
+ inventory.append([sensor[0], nom_temp])
return inventory
@@ -70,33 +70,28 @@ def check_f5_bigip_temp(item, params, info):
for sensor in f5_bigip_temp_genitem(info):
if item == sensor[0]:
- 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)
+ 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 + "!")
else:
return (3, "UNKNOWN - unable to read Temperature")
+
-
-
+
return (3, "UNKNOWN - item not found in SNMP output")
-
+
snmp_info["f5_bigip_temp"] = \
[ (".1.3.6.1.4.1.3375.2.1.3.2.3.2.1", [ 1, 2 ]),
( ".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", 1,
inventory_f5_bigip_temp)
+check_info["f5_bigip_temp"] = (check_f5_bigip_temp, "TEMP %s", 0,
inventory_f5_bigip_temp )
# Get ID and Speed from the CPU and chassis fan tables
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 071ab55..f978e06 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -187,10 +187,6 @@ def perfometer_check_mk_ipmi_sensors(row, check_command, perf_data):
# Also all checks dealing with temperature can use this perfometer
perfometers["check_mk-ipmi_sensors"] = perfometer_check_mk_ipmi_sensors
perfometers["check_mk-nvidia.temp"] = perfometer_check_mk_ipmi_sensors
-perfometers["check_mk-f5_bigip_temp"] = perfometer_check_mk_ipmi_sensors
-perfometers["check_mk-apc_symmetra_temp"] = perfometer_check_mk_ipmi_sensors
-perfometers["check_mk-apc_symmetra_ext_temp"] =
perfometer_check_mk_ipmi_sensors
-perfometers["check_mk-cmctc.temp"] = perfometer_check_mk_ipmi_sensors
def perfometer_check_mk_if(row, check_command, perf_data):
txt = []