Module: check_mk
Branch: master
Commit: d36ccca14fa585dfd7ef1823ae59ae0d8895eb2e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d36ccca14fa585…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Jun 24 12:07:30 2011 +0200
f5_bigip_temp: fix/add performeter and rrd
---
checks/f5_bigip_temp | 22 ++++++++--------
pnp-rraconf/check_mk-f5_bigip_temp.rra.cfg | 1 +
pnp-templates/check_mk-f5_bigip_temp.php | 36 ++++++++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 1 +
4 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/checks/f5_bigip_temp b/checks/f5_bigip_temp
index 9579384..c1c98f0 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], sensor[2]])
return inventory
@@ -73,30 +73,30 @@ def check_f5_bigip_temp(item, params, info):
cur_temp = sensor[1]
nom_temp = sensor[2]
# allow some increase in temperature to avoid false alarms
- warn = nom_temp + 9
+ 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)
+ return (0, "OK" + msgtxt, perfdata)
elif crit <= cur_temp:
- return (2, "CRIT" + msgtxt + "!!", perfdata)
+ return (2, "CRIT" + msgtxt + "!!", perfdata)
elif warn < cur_temp:
- return (1, "WARN" + msgtxt + "!", perfdata)
+ return (1, "WARN" + msgtxt + "!", perfdata)
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", 1, inventory_f5_bigip_temp )
# Get ID and Speed from the CPU and chassis fan tables
diff --git a/pnp-rraconf/check_mk-f5_bigip_temp.rra.cfg b/pnp-rraconf/check_mk-f5_bigip_temp.rra.cfg
new file mode 120000
index 0000000..19dbf77
--- /dev/null
+++ b/pnp-rraconf/check_mk-f5_bigip_temp.rra.cfg
@@ -0,0 +1 @@
+max.rra.cfg
\ No newline at end of file
diff --git a/pnp-templates/check_mk-f5_bigip_temp.php b/pnp-templates/check_mk-f5_bigip_temp.php
new file mode 100644
index 0000000..8d9dfc1
--- /dev/null
+++ b/pnp-templates/check_mk-f5_bigip_temp.php
@@ -0,0 +1,36 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+$opt[1] = "--vertical-label \"Celsius\" -l 0 -u 70 --title \"Temperature $servicedesc\" ";
+
+$def[1] = "DEF:var1=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "AREA:var1#2080ff:\"Temperature\:\" ";
+$def[1] .= "GPRINT:var1:LAST:\"%2.0lfC\" ";
+$def[1] .= "LINE1:var1#000080:\"\" ";
+$def[1] .= "GPRINT:var1:MAX:\"(Max\: %2.0lfC,\" ";
+$def[1] .= "GPRINT:var1:AVERAGE:\"Avg\: %2.0lfC)\" ";
+$def[1] .= "HRULE:$WARN[1]#FFFF00:\"Warning\: $WARN[1]C\" ";
+$def[1] .= "HRULE:$CRIT[1]#FF0000:\"Critical\: $CRIT[1]C\" ";
+?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index f978e06..4c65084 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -187,6 +187,7 @@ 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
def perfometer_check_mk_if(row, check_command, perf_data):
txt = []