Module: check_mk
Branch: master
Commit: e355a3a496d15813416254b2019a6d56496ba2b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e355a3a496d158…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Sep 16 14:31:06 2014 +0200
fixed exception in uptime calculation
---
checks/hivemanager_devices | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/checks/hivemanager_devices b/checks/hivemanager_devices
index e3ca09d..6de033a 100644
--- a/checks/hivemanager_devices
+++ b/checks/hivemanager_devices
@@ -75,11 +75,11 @@ def check_hivemanager_devices(item, params, info):
#Uptime
if uptime != 'down':
- days, hrs, mins, secs = map(int, uptime.split()[::2])
- uptime_secs = secs
- uptime_secs += days * 86400
- uptime_secs += hrs * 3600
- uptime_secs += mins * 60
+ uptime_tokens = map(int, uptime.split()[-2::-2])
+ token_multiplier = [1, 60, 3600, 86400]
+ uptime_secs = 0
+ for idx, entry in enumerate(uptime_tokens):
+ uptime_secs += token_multiplier[idx] * entry
infotext = "Uptime: %s" % get_age_human_readable(uptime_secs)
state = 0