Module: check_mk
Branch: master
Commit: ef9687948b908350ec26cdb3dfcdedfff4222b1b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ef9687948b9083…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Oct 2 12:12:17 2014 +0200
ups_bat_temp: Now uses temperature.include
---
checks/ups_bat_temp | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/checks/ups_bat_temp b/checks/ups_bat_temp
index 507ef5f..dcc7827 100644
--- a/checks/ups_bat_temp
+++ b/checks/ups_bat_temp
@@ -32,22 +32,12 @@ def inventory_ups_bat_temp(info):
return [ ( x[0], "ups_bat_temp_default") for x in info ]
def check_ups_bat_temp(item, params, info):
- warn, crit = params
for line in info:
if line[0] == item:
- power = saveint(line[1])
- perfdata = [ ( "temp", power, warn, crit, 80 ) ]
- infotext = "temperature: %d°C , (warn/crit at %d°C/%d°C) " % \
- (power, warn, crit)
+ status, infotext, perfdata = check_temperature(int(line[1]), params)
+ perfdatanew = [ perfdata[0] + (80,) ]
+ return status, infotext, perfdatanew
- if power >= crit:
- return (2, infotext, perfdata)
- elif power >= warn:
- return (1, infotext, perfdata)
- else:
- return (0, infotext, perfdata)
-
- return (3, "Temperature %s not found in SNMP output" % item)
check_info['ups_bat_temp'] = {
"inventory_function" : inventory_ups_bat_temp,
@@ -59,5 +49,5 @@ check_info['ups_bat_temp'] = {
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") in \
[ ".1.3.6.1.4.1.818.1.100.1.1",
".1.3.6.1.4.1.705.1.2", ".1.3.6.1.2.1.33",
".1.3.6.1.2.1.33.2", ".1.3.6.1.4.1.818.1.100.1.2" ] \
or
oid('.1.3.6.1.2.1.33.1.1.1.0').startswith('RPS'),
-
+ "includes" : [ "temperature.include" ],
}