Module: check_mk
Branch: master
Commit: 4dfbb1be5bf67b4523e8a4e1fe68c7bb1d9d03c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dfbb1be5bf67b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 1 12:38:04 2012 +0100
lgp_pdu_aux: Fixed UOM shown in humidity checks
---
.bugs/668 | 2 ++
checks/lgp_pdu_aux | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/.bugs/668 b/.bugs/668
index 7527616..09cde3e 100644
--- a/.bugs/668
+++ b/.bugs/668
@@ -8,3 +8,5 @@ Class: bug
When clicking on the rotating arrows only the error
message ERROR cannot reschedule check: time out
appears (after ~ 1 sec.)
+
+LM: Works for me.
diff --git a/checks/lgp_pdu_aux b/checks/lgp_pdu_aux
index 7edfdb8..9b42b30 100644
--- a/checks/lgp_pdu_aux
+++ b/checks/lgp_pdu_aux
@@ -132,7 +132,7 @@ def check_lgp_pdu_aux(item, params, info):
else:
output.append('Label: ' + pdu['SystemLabel'])
- def handle_type(ty, label):
+ def handle_type(ty, label, uom):
state = 0
perfdata = (ty.lower(), pdu[ty],
'%0.2f:%0.2f' % (pdu[ty+'LowWarn'],
pdu[ty+'HighWarn']),
@@ -151,15 +151,15 @@ def check_lgp_pdu_aux(item, params, info):
state = 1
s_out = ' <= %0.2f (!)' % pdu[ty+'LowWarn']
- return state, '%s: %0.2fC%s' % (label, pdu[ty], s_out), perfdata
+ return state, '%s: %0.2f%s%s' % (label, pdu[ty], uom, s_out),
perfdata
if pdu['Type'] == 'TEMP':
- state, out, perf = handle_type('Temp', 'Temperature')
+ state, out, perf = handle_type('Temp', 'Temperature',
'C')
output.append(out)
perfdata.append(perf)
elif pdu['Type'] == 'HUM':
- state, out, perf = handle_type('Hum', 'Humidity')
+ state, out, perf = handle_type('Hum', 'Humidity',
'%')
output.append(out)
perfdata.append(perf)