Module: check_mk
Branch: master
Commit: 2ad76288321e3eaf909a54e18375d49488a54284
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ad76288321e3e…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Jan 4 10:32:53 2017 +0100
4184 FIX hivemanager_devices: Fixed bug if device is up for more than 1 year
The checkplugin does not crash anymore if a device is up for more than 1 year.
Change-Id: I72143751b5d011a6ea4833e0b8d273e87fbe2490
---
.werks/4184 | 10 ++++++++++
ChangeLog | 1 +
checks/hivemanager_devices | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/4184 b/.werks/4184
new file mode 100644
index 0000000..9ae048e
--- /dev/null
+++ b/.werks/4184
@@ -0,0 +1,10 @@
+Title: hivemanager_devices: Fixed bug if device is up for more than 1 year
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483522214
+Class: fix
+
+The checkplugin does not crash anymore if a device is up for more than 1 year.
+
diff --git a/ChangeLog b/ChangeLog
index 2a90dd8..073a4c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 4182 FIX: mysql_slave: fixed crash if agent output is empty...
* 4176 FIX: postfix_mailq_status: fixed wrong status handling
* 4183 FIX: ibm_imm_fan: Fixed crash if fan speed is "unavailable"...
+ * 4184 FIX: hivemanager_devices: Fixed bug if device is up for more than 1 year...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/hivemanager_devices b/checks/hivemanager_devices
index 9a91de5..a440041 100644
--- a/checks/hivemanager_devices
+++ b/checks/hivemanager_devices
@@ -81,7 +81,7 @@ def check_hivemanager_devices(item, params, info):
uptime_secs = 0
if infos['upTime'] != 'down':
uptime_tokens = map(int, infos['upTime'].split()[-2::-2])
- token_multiplier = [1, 60, 3600, 86400]
+ token_multiplier = [1, 60, 3600, 86400, 31536000]
for idx, entry in enumerate(uptime_tokens):
uptime_secs += token_multiplier[idx] * entry
infotext = "Uptime: %s" % get_age_human_readable(uptime_secs)