Module: check_mk
Branch: master
Commit: 9f741d79a58bfadd7c851d5f5c15237e713bd79b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f741d79a58bfa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 2 10:48:09 2015 +0100
#2082 FIX jolokia_metrics.mem: Fixed levels on total memory usage
---
.werks/2082 | 10 ++++++++++
ChangeLog | 1 +
checks/jolokia_metrics | 17 +++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.werks/2082 b/.werks/2082
new file mode 100644
index 0000000..dc4bff1
--- /dev/null
+++ b/.werks/2082
@@ -0,0 +1,10 @@
+Title: jolokia_metrics.mem: Fixed levels on total memory usage
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425289660
+
+
diff --git a/ChangeLog b/ChangeLog
index 54fd205..c3f82fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -212,6 +212,7 @@
* 2027 FIX: fc_port: Fixed exception when wirespeed is reported as 0 by the device
* 1224 FIX: Fixed rare Bug in case of clusterd network interfaces...
* 2079 FIX: freebsd agent: Was unable to find ntpq command with FreeBSD10...
+ * 2082 FIX: jolokia_metrics.mem: Fixed levels on total memory usage
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index d568a71..8770010 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -238,6 +238,7 @@ def check_jolokia_metrics_mem(item, params, info):
# rename totalheap to total
# this block can be removed in the future (today 22.02.13)
if "totalheap" in params:
+ params = params.copy()
params["total"] = params["totalheap"]
del params["totalheap"]
@@ -271,11 +272,13 @@ def check_jolokia_metrics_mem(item, params, info):
warn_level = 0
crit_level = 0
if type(params[what][0]) == int:
+ if value_max:
+ warn_level = value_max - params[what][0]
+ crit_level = value_max - params[what][1]
+
if what != "total":
- if value_max:
- warn_level = value_max - params[what][0]
- crit_level = value_max - params[what][1]
perfdata.append((what, value, warn_level, crit_level, "",
value_max))
+
if not value_max:
param_state = 0
elif value >= crit_level:
@@ -285,11 +288,13 @@ def check_jolokia_metrics_mem(item, params, info):
param_state = 1
level_info = "%s(warn at %sMB free)" % (state_markers[1],
params[what][0])
else:
+ if value_max:
+ warn_level = value_max * params[what][0] / 100.0
+ crit_level = value_max * params[what][1] / 100.0
+
if what != "total":
- if value_max:
- warn_level = value_max * params[what][0] / 100.0
- crit_level = value_max * params[what][1] / 100.0
perfdata.append((what, value, warn_level, crit_level, "",
value_max))
+
if not value_max:
param_state = 0
elif value >= crit_level: