Module: check_mk
Branch: master
Commit: 8ac44d091401c6f0c04f95dd0736d25a4040aa4a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ac44d091401c6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 13 17:17:47 2014 +0200
fixed some wording and tabs
---
checks/cisco_temp_sensor | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 2a1d8f1..66cdff4 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -130,11 +130,10 @@ def parse_cisco_temp_sensor(info):
# Create main dictionary (only of temperature sensors)
sensors = []
for id, sensortype, value, sensorstate in state_info:
- # poor try to find temperature values
- # who are given in tens of degress.
- # Seems that some new firmware show this behavier.
- # A normal Temperature Sensor has only a range up to
- # 60 degree, so i choiced 70.
+ # Poor try to find temperature values, which are given in tenths of degrees.
+ # Seems that some new firmware shows this behaviour.
+ # A normal temperature sensor has only a range up to
+ # 60 degree, so we've chosen 70.
value = saveint(value)
if value > 70:
value = value / 10
@@ -165,18 +164,20 @@ def check_cisco_temp_sensor(item, params, info):
levels = " (warn/crit at %.1f/%.1f °C)" % (warn, crit)
perfdata = [ ( "temperature", temp, warn, crit ) ]
state = 0
- if sensorstate == "2":
- return (3, "data from sensor currently not available")
- elif sensorstate == "3":
- return (3, "sensor is broken")
- if temp >= crit:
- state = 2
- infotext += levels
- elif temp >= warn:
- state = 1
- infotext += levels
- return state, infotext, perfdata
- return (3, "sensor not found in SNMP data")
+
+ if sensorstate == "2":
+ return (3, "Data from sensor currently not available")
+ elif sensorstate == "3":
+ return (3, "Sensor is broken")
+
+ if temp >= crit:
+ state = 2
+ infotext += levels
+ elif temp >= warn:
+ state = 1
+ infotext += levels
+ return state, infotext, perfdata
+ return (3, "Sensor not found in SNMP data")
check_info['cisco_temp_sensor'] = {
Module: check_mk
Branch: master
Commit: 70fea83a663d3a7b20166991cac19b4477f7c9d3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70fea83a663d3a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 13 17:12:55 2014 +0200
fixed exception in cisco_temp_sensor
---
checks/cisco_temp_sensor | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 06cc9cd..2a1d8f1 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -119,13 +119,13 @@ def parse_cisco_temp_sensor(info):
for id, sensortype, value, sensorstate in state_info:
thresholds.setdefault(id, [])
- for endoid, level in levels_info:
+ for endoid, levels in levels_info:
# endoid is e.g. 21549.9 or 21459.10
level = saveint(levels)
if level > 70:
level = level / 10
id, subid = endoid.split('.')
- thresholds.setdefault(id, []).append(level)
+ thresholds.setdefault(id, []).append(levels)
# Create main dictionary (only of temperature sensors)
sensors = []
@@ -134,7 +134,7 @@ def parse_cisco_temp_sensor(info):
# who are given in tens of degress.
# Seems that some new firmware show this behavier.
# A normal Temperature Sensor has only a range up to
- # 60 degree, so i choiced 70.
+ # 60 degree, so i choiced 70.
value = saveint(value)
if value > 70:
value = value / 10