Module: check_mk
Branch: master
Commit: 376bf5bd48b3804d53f36a5b81d48b9a9fa1a2bf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=376bf5bd48b380…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Apr 22 11:30:42 2014 +0200
fsc_fans: Added support for Wato configuration and upper limits
---
.werks/152 | 8 ++++----
ChangeLog | 2 +-
checkman/fsc_fans | 7 +++++++
checks/fsc_fans | 24 +++++++++++++++++-------
web/htdocs/images/icons/klipper.png | Bin 3364 -> 0 bytes
5 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/.werks/152 b/.werks/152
index bed4540..04392a6 100644
--- a/.werks/152
+++ b/.werks/152
@@ -1,8 +1,8 @@
-Title: windows_updates: Added Error Handling (Thanks to Stefan Kick)
+Title: fsc_fans: Added support for Wato configuration and upper limits
Level: 1
Component: checks
Version: 1.2.5i3
-Date: 1397744176
-Class: fix
+Date: 1398159011
+Class: feature
+
-The windows_update plugin now also handles windows servers with deactivated update
function.
diff --git a/ChangeLog b/ChangeLog
index e7698e8..a634b46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
* 0892 wagner_titanus_topsense: new info check and overall status check for Wagner
Titanus Top Sens devices
* 0893 wagner_titanus_topsense.alarm: New check for Alarms Triggered on Wagner
Titanus Top Sens devices
* 0894 wagner_titanus_topsense.smoke: New check for Smoke Detectors in Wagner Titanus
Top Sens devices
+ * 0152 fsc_fans: Added support for Wato configuration and upper limits
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
@@ -44,7 +45,6 @@
* 0882 FIX: check_bi_local.py: fix crash in case of non-ascii characters...
* 0606 FIX: apache_status: now also sends an accept header to make it work with
mod_security enables servers
* 0832 FIX: solaris_mem: fixed invalid calculation of total swap...
- * 0152 FIX: windows_updates: Added Error Handling (Thanks to Stefan Kick)...
* 0810 FIX: fritz.link: Not inventorizing "unconfigured" interfaces
anymore
Multisite:
diff --git a/checkman/fsc_fans b/checkman/fsc_fans
index af94484..617d5d4 100644
--- a/checkman/fsc_fans
+++ b/checkman/fsc_fans
@@ -16,3 +16,10 @@ description:
inventory:
The check creates one service for each FAN provided in the SNMP data.
+
+[parameters]
+parameters(dict): parameters is a dictionary with two keys
+
+ {"lower"}: a tuple of lower warning and critical values for the fan rpm
+
+ {"upper"}: a tuple of upper warning and critical values for the fan rpm
diff --git a/checks/fsc_fans b/checks/fsc_fans
index 78bc2bb..01644cc 100644
--- a/checks/fsc_fans
+++ b/checks/fsc_fans
@@ -29,20 +29,29 @@ def inventory_fsc_fans(info):
return [ (line[0], line[1], (int(line[1]) * 0.9, int(line[1]) * 0.8)) for line in
info if int(line[1]) > 0 ]
def check_fsc_fans(item, params, info):
- warn, crit = params
+ 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['upper']
+
for line in info: # , value1, value2 in info:
name = line[0]
if name != item: continue
rpm = int(line[1])
- perfdata = [ ( 'rpm', rpm, warn, crit, 0 ) ]
+ perfdata = [ ( 'rpm', rpm, low_warn, low_crit, 0 ) ]
infotext = "%d RPM" % rpm
- if rpm < crit:
- return (2, "%s" % infotext, perfdata)
- elif rpm < warn:
- return (1, "%s" % infotext, perfdata)
+ 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, "%s" % infotext, perfdata)
+ return 0, infotext, perfdata
return (3, "FAN %s not found in SNMP data" % item)
@@ -50,6 +59,7 @@ def check_fsc_fans(item, params, info):
check_info["fsc_fans"] = {
'check_function': check_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]),
diff --git a/web/htdocs/images/icons/klipper.png b/web/htdocs/images/icons/klipper.png
deleted file mode 100644
index ea9c78e..0000000
Binary files a/web/htdocs/images/icons/klipper.png and /dev/null differ