Module: check_mk
Branch: master
Commit: 4c79e718ae0bfaf02315cb63a4545164c2e16e7c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c79e718ae0bfa…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Mar 13 18:14:54 2015 +0100
#1895 FIX temperature.include: Fixed Fahrenheit handling
Fahrenheit device levels didn't work properly. This has been fixed.
(Thanks to Rustam Akhmarov for this fix)
---
.werks/1895 | 11 +++++++++++
ChangeLog | 3 +--
checks/temperature.include | 4 ++--
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/.werks/1895 b/.werks/1895
new file mode 100644
index 0000000..bbcd1cd
--- /dev/null
+++ b/.werks/1895
@@ -0,0 +1,11 @@
+Title: temperature.include: Fixed Fahrenheit handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426266810
+
+Fahrenheit device levels didn't work properly. This has been fixed.
+(Thanks to Rustam Akhmarov for this fix)
diff --git a/ChangeLog b/ChangeLog
index ab4a302..95ae2ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -254,9 +254,8 @@
* 2094 FIX: Fixed missing agent section when ntpq times out after 5 seconds
* 2095 FIX: oracle_crs_voting: Also handling voting disks with id 0 (seen on old CRS
10.2.0.5.0)...
* 2101 FIX: cisco_temperature: check can now handle cases when no description of the
sensor is available
- * 2103 FIX: mbg_lantime_ng_temp: levels were not working...
- NOTE: Please refer to the migration notes!
* 2096 FIX: jolokia_metrics: Now deal with missing thread related infos (jboss might
only send ThreadCount)
+ * 1895 FIX: temperature.include: Fixed Fahrenheit handling...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/temperature.include b/checks/temperature.include
index a0cc842..a062cae 100644
--- a/checks/temperature.include
+++ b/checks/temperature.include
@@ -41,10 +41,10 @@ def from_celsius(tempc, unit):
def to_celsius(reading, unit):
if type(reading) == tuple:
- tuple([to_celsius(x, unit) for x in reading])
+ return tuple([to_celsius(x, unit) for x in reading])
elif unit == "f":
return fahrenheit_to_celsius(reading)
- if unit == "k":
+ elif unit == "k":
return reading - 273.15
else:
return reading