Module: check_mk
Branch: master
Commit: c0cf3a4c994955c40e91c59ad9739c979369761c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0cf3a4c994955…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Jan 21 16:13:01 2015 +0100
#1888 bintec_sensors.fan: No longer outputs performance data, now configured via
"fan" rule
This check is now configured via a different WATO rule, so any old rules set will no
longer apply. Re-inventory required.
---
.werks/1888 | 9 +++++++++
ChangeLog | 9 ++++-----
checkman/bintec_sensors.fan | 26 ++++----------------------
checks/bintec_sensors | 21 ++++-----------------
4 files changed, 21 insertions(+), 44 deletions(-)
diff --git a/.werks/1888 b/.werks/1888
new file mode 100644
index 0000000..fbd795d
--- /dev/null
+++ b/.werks/1888
@@ -0,0 +1,9 @@
+Title: bintec_sensors.fan: No longer outputs performance data, now configured via
"fan" rule
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i1
+Date: 1421853099
+Class: feature
+
+This check is now configured via a different WATO rule, so any old rules set will no
longer apply. Re-inventory required.
diff --git a/ChangeLog b/ChangeLog
index 3426c01..2e842a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,13 +48,12 @@
NOTE: Please refer to the migration notes!
* 1525 viprinet_temp: Now uses new Temperature WATO rule...
NOTE: Please refer to the migration notes!
-<<<<<<< HEAD
- * 1526 climaveneta_fan: No longer outputs performance data, now configured via
"fan" rule...
- NOTE: Please refer to the migration notes!
-=======
* 1673 netapp_volumes: now able to configure levels by magic factor
* 1854 netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler
Loadbalancer Appliances
->>>>>>> 92eaa76066f0ba1122cb72f4f1f783d8c0439378
+ * 1526 climaveneta_fan: No longer outputs performance data, now configured via
"fan" rule...
+ NOTE: Please refer to the migration notes!
+ * 1888 bintec_sensors.fan: No longer outputs performance data, now configured via
"fan" rule...
+ NOTE: Please refer to the migration notes!
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/bintec_sensors.fan b/checkman/bintec_sensors.fan
index 3e65d61..4bcc3b2 100644
--- a/checkman/bintec_sensors.fan
+++ b/checkman/bintec_sensors.fan
@@ -6,33 +6,15 @@ distribution: check_mk
description:
Checks the Fan Speed of Bintec Routers.
- Returns {WARN} or {CRIT} if the speed is above or equal given levels or it is
- below or equal given levels.
-
item:
The sensorDescr from SNMP.
-examples:
- # set new default levels
- bintec_sensors_fan_default_levels = { "lower": ( 1, 1000), "upper":
(9000, 10000) }
-
- # check Fan 1 of router1 with default levels
- checks += [
- ("router1", "bintec_sensors.fan", 'Fan 1',
bintec_sensors_fan_default_levels)
- ]
-
perfdata:
- One value: The speed of the fan in rpm, together with the upper and lower
- levels for {WARN} and {CRIT}.
+ None
inventory:
- Creates one check per fan, concrete: One check for every sensor of sensorType 2
- (fan).
+ For each fan one service is created
[parameters]
-dict: key "lower" references a tuple with lower crit level and lower warn
level.
- key "upper" references a tuple with upper warn level and upper crit level.
-
-[configuration]
-bintec_sensors_fan_default_levels (dict):
- defaults to { "lower": ( 1000, 2000), "upper": (8000, 8400)
+warn (int): Warning if speed is below
+crit (int): Critical if speed is below
diff --git a/checks/bintec_sensors b/checks/bintec_sensors
index cf3874d..f9104f5 100644
--- a/checks/bintec_sensors
+++ b/checks/bintec_sensors
@@ -44,7 +44,7 @@ bintec_sensors_info = ( ".1.3.6.1.4.1.272.4.17.7.1.1.1", [
# | |
# '----------------------------------------------------------------------'
-bintec_sensors_fan_default_levels = { "lower": ( 1000, 2000),
"upper": (8000, 8400) }
+bintec_sensors_fan_default_levels = (2000, 1000)
def inventory_bintec_sensors_fan(info):
inventory = []
@@ -56,29 +56,16 @@ def inventory_bintec_sensors_fan(info):
def check_bintec_sensors_fan(item, params, info):
for sensor_id, sensor_descr, sensor_type, sensor_value, sensor_unit in info:
if sensor_descr == item:
- status = 0
- sensor_value = int(sensor_value)
- if sensor_value <= params["lower"][1] or sensor_value >=
params["upper"][0]:
- status = 1
- if sensor_value <= params["lower"][0] or sensor_value >=
params["upper"][1]:
- status = 2
-
- message = "%s is at %s %s" % (sensor_descr, sensor_value,
sensor_unit)
- perfdata = [ ("rpm", sensor_value, "%d:%d" %
(params["lower"][1], params["upper"][0]), \
- "%d:%d" % (params["lower"][0],
params["upper"][1]), 0) ]
-
- return status, message, perfdata
-
- return 3, "Sensor %s not found" % item
+ return check_fan(int(sensor_value), params)
check_info["bintec_sensors.fan"] = {
"check_function" : check_bintec_sensors_fan,
"inventory_function" : inventory_bintec_sensors_fan,
"service_description" : "%s",
- "group" : "hw_fans",
- "has_perfdata" : True,
"snmp_info" : bintec_sensors_info,
"snmp_scan_function" : bintec_sensors_scan,
+ "group" : "fan",
+ "includes" : [ "fan.include" ],
}
#.