Module: check_mk
Branch: master
Commit: 6839b534656469dbed1979d5591551fe050253a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6839b534656469…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Oct 2 12:10:09 2014 +0200
rms200_temp: Now uses temperature.include
---
checks/rms200_temp | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/checks/rms200_temp b/checks/rms200_temp
index d46a986..f374f01 100644
--- a/checks/rms200_temp
+++ b/checks/rms200_temp
@@ -24,26 +24,20 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-rms200_temp_default_levels = ( 25, 28 )
+rms200_temp_default_levels = (25, 28)
+
def inventory_rms200_temp(info):
- return [ (x[0], "rms200_temp_default_levels" ) for x in info if x[2] !=
'0']
+ return [ (x[0], "rms200_temp_default_levels") for x in info if x[2] !=
'0']
+
def check_rms200_temp(item, params, info):
for line in info:
if line[0] == item:
- warn, crit = params
- temp = float(line[2])/100
- name = line[1]
- state = 0
- if temp >= crit:
- state = 2
- elif temp >= warn:
- state = 1
- message = "Current Temperature: %.2f °C (%s)" % (temp, name)
- perf = [ ('temp', temp, warn, crit ) ]
- return state, message, perf
- return 3, "No information found about the device"
+ status, infotext, perfdata = check_temperature(float(line[2])/100, params)
+ infotext += " (%s)" % line[1] # Name from SNMP data
+ return status, infotext, perfdata
+
check_info["rms200_temp"] = {
"check_function" : check_rms200_temp,
@@ -57,5 +51,6 @@ check_info["rms200_temp"] = {
2, # Name,
5, # Temp
] ),
+ "includes" : [ "temperature.include" ],
}