Module: check_mk
Branch: master
Commit: 4998cd1d724454fabe65d58f17fca163c9b2db76
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4998cd1d724454…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed May 24 16:14:31 2017 +0200
4633 FIX jolokia_metrics.uptime: No longer crash when agent info is incomplete
Change-Id: Ib6be2fc49cc1b3fd8a69e823ffd16cada93e6c70
---
.werks/4633 | 11 +++++++++++
checks/jolokia_metrics | 5 +++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/4633 b/.werks/4633
new file mode 100644
index 0000000..dc3459d
--- /dev/null
+++ b/.werks/4633
@@ -0,0 +1,11 @@
+Title: jolokia_metrics.uptime: No longer crash when agent info is incomplete
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1495635204
+
+
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index 5b0f414..dad38d3 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -704,8 +704,9 @@ def check_jolokia_metrics_uptime(item, params, info):
if parsed.get(item, "") == None:
raise MKCounterWrapped("No information from Jolokia agent")
if item in parsed:
- uptime = int(parsed[item]['Uptime']) / 1000
- return check_uptime_seconds(params, uptime)
+ if "Uptime" in parsed[item]:
+ uptime = int(parsed[item]['Uptime']) / 1000
+ return check_uptime_seconds(params, uptime)
check_info["jolokia_metrics.uptime"] = {