Module: check_mk
Branch: master
Commit: 90df37d95c06ae9ab70476cad78fc65b7b750c73
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90df37d95c06ae…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Mar 28 14:55:15 2014 +0100
cisco_temp_sensor: Check cleanup
---
checks/cisco_temp_sensor | 60 ++++++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 29 deletions(-)
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 32c5d7d..19404b5 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -159,32 +159,34 @@ def check_cisco_temp_sensor(item, _no_params, info):
( "temperature", value, warn, crit ) ])
return (3, "sensor not found in SNMP data")
-check_info['cisco_temp_sensor'] = (check_cisco_temp_sensor, "Temperature
%s", 1, inventory_cisco_temp_sensor)
-
-snmp_info['cisco_temp_sensor'] = [
- # Description of sensors
- ( ".1.3.6.1.2.1.47.1.1.1.1", [
- OID_END,
- 2, # Description of the sensor
- ]),
-
- # Type and current state
- ( ".1.3.6.1.4.1.9.9.91.1.1.1.1", [
- OID_END,
- 1, # Type (see above), 8 = Celsius, 12 = truth value
- 4, # Most recent measurement
- 5, # Status of the sensor 1 == ok, 2 == cannot report, 3 == broken
- ]),
-
- # Threshold
- ( ".1.3.6.1.4.1.9.9.91.1.2.1.1", [
- OID_END,
- 4, # Thresholds
- ]),
-]
-
-snmp_scan_functions['cisco_temp_sensor'] = \
- lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
- oid(".1.3.6.1.4.1.9.9.91.1.1.1.1.*") != None
-
-checkgroup_of["cisco_temp_sensor"] = "temperature_auto"
+
+check_info['cisco_temp_sensor'] = {
+ "check_function" : check_cisco_temp_sensor,
+ "inventory_function" : inventory_cisco_temp_sensor,
+ "service_description": "Temperature %s",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: "cisco" in
oid(".1.3.6.1.2.1.1.1.0").lower() and \
+ oid(".1.3.6.1.4.1.9.9.91.1.1.1.1.*") !=
None,
+ "snmp_info" : [
+ ( ".1.3.6.1.2.1.47.1.1.1.1", [
+ OID_END,
+ 2, # Description of the sensor
+ ]),
+
+ # Type and current state
+ ( ".1.3.6.1.4.1.9.9.91.1.1.1.1", [
+ OID_END,
+ 1, # Type (see above), 8 = Celsius, 12 = truth value
+ 4, # Most recent measurement
+ 5, # Status of the sensor 1 == ok, 2 == cannot report, 3
== broken
+ ]),
+
+ # Threshold
+ ( ".1.3.6.1.4.1.9.9.91.1.2.1.1", [
+ OID_END,
+ 4, # Thresholds
+ ]),
+ ],
+ "group" : "temperature_auto"
+}
+