Module: check_mk
Branch: master
Commit: 81c11b9bed10c5d2215c0d64fbcfa99ea326c2fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=81c11b9bed10c5…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Feb 11 16:20:05 2015 +0100
fsc_fans: Now uses fan.include, no longer outputs performance data.
---
checks/fsc_fans | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/checks/fsc_fans b/checks/fsc_fans
index f86a8f4..03453aa 100644
--- a/checks/fsc_fans
+++ b/checks/fsc_fans
@@ -30,30 +30,13 @@ def inventory_fsc_fans(info):
def check_fsc_fans(item, params, info):
if type(params) == tuple:
- low_warn, low_crit = params
- up_warn, up_crit = None, None
- else:
- low_warn, low_crit = params['lower']
- up_warn, up_crit = params.get('upper', ( None, None))
+ params = { 'lower' : params }
for line in info: # , value1, value2 in info:
name = line[0]
if name != item: continue
rpm = int(line[1])
-
- perfdata = [ ( 'rpm', rpm, low_warn, low_crit, 0 ) ]
- infotext = "%d RPM" % rpm
- levels = "Warn/Crit Lower: %d/%d " % (low_warn, low_crit )
- if up_crit:
- levels += "Upper: %d/%d" % ( up_warn, up_crit )
- if rpm < low_crit or (up_crit and rpm > up_crit):
- return 2, infotext + levels, perfdata
- elif rpm < low_warn or (up_warn and rpm > up_warn):
- return 1, infotext + levels, perfdata
- else:
- return 0, infotext, perfdata
-
- return (3, "FAN %s not found in SNMP data" % item)
+ return check_fan(rpm, params)
check_info["fsc_fans"] = {
@@ -61,8 +44,8 @@ check_info["fsc_fans"] = {
'inventory_function': inventory_fsc_fans,
'group': "hw_fans",
'service_description': 'FSC %s',
- 'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.231.2.10.2.2.5.2.2.1', [16,
8]),
'snmp_scan_function': lambda oid: \
oid(".1.3.6.1.4.1.231.2.10.2.1.1.0"),
+ 'includes': [ 'fan.include' ],
}