Module: check_mk
Branch: master
Commit: 84ae45519bee95b380c0d8a7c1352dae1bee4617
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=84ae45519bee95…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Nov 22 11:14:18 2016 +0100
3751 FIX jolokia_metrics: Discovery no longer crashes in case of error querying instance
---
.werks/3751 | 9 +++++++++
ChangeLog | 1 +
checks/jolokia_metrics | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/3751 b/.werks/3751
new file mode 100644
index 0000000..7c37095
--- /dev/null
+++ b/.werks/3751
@@ -0,0 +1,9 @@
+Title: jolokia_metrics: Discovery no longer crashes in case of error querying instance
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i3
+Date: 1479809600
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index deeab60..9aca2e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* 3940 FIX: aix_hacmp_services: fixed broken check in case of agent section showing extra information before the "Status(...)" line...
* 3941 FIX: zypper: fixed broken check for sections since agent OS SLES12...
* 4043 FIX: Add missing metric definition for 15 minute CPU load prediction'
+ * 3751 FIX: jolokia_metrics: Discovery no longer crashes in case of error querying instance
Multisite:
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index 39f93eb..494518b 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -863,7 +863,7 @@ jolokia_metrics_cache_hits_default_levels = {}
def inventory_jolokia_metrics_cache(key, metrics, info):
parsed = jolokia_metrics_parse(info)
metrics_set = set(metrics)
- for inst, vals in parsed.iteritems():
+ for inst, vals in [ x for x in parsed.iteritems() if x[1] != None ]:
for cache, cache_vars in vals.get("CacheStatistics", {}).iteritems():
if metrics_set.intersection(cache_vars) == metrics_set:
if key is None: