Module: check_mk
Branch: master
Commit: 04e5b290969f20c70d112724a7a2faf065ec6a12
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04e5b290969f20…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Feb 22 10:56:14 2013 +0100
FIX: jolokia_metrics.mem: renamed parameter totalheap to total
---
ChangeLog | 1 +
checkman/jolokia_metrics.mem | 10 +++++-----
checks/jolokia_metrics | 14 ++++++++++----
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1c72ecb..f8d3065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,7 @@
* ps: Allow %1, %2, .. instead of %s in process_inventory. That allows
reordering of matched groups
* FIX: check_mk_base: fixed rounding error in get_bytes_human_readable
+ * FIX: jolokia_metrics.mem: renamed parameter totalheap to total
Multisite:
* FIX: Fixed problem with error during localization scanning
diff --git a/checkman/jolokia_metrics.mem b/checkman/jolokia_metrics.mem
index 2a2a5e7..dc1225a 100644
--- a/checkman/jolokia_metrics.mem
+++ b/checkman/jolokia_metrics.mem
@@ -22,7 +22,7 @@ examples:
jolokia_metrics_mem_default_levels = {
"heap" : (2000,1000), # heap warning when 2000MB left, heap crit when
1000 MB left
"nonheap" : (75.0, 95.7), # nonheap warning at 75.0% usage, nonheap crit
at 95.7% usage
- "totalheap" : (3000, 2200), # totalheap warning at 3000MB left, totalheap
crit at 2200MB left
+ "total" : (3000, 2200), # total warning at 3000MB left, total crit at
2200MB left
}
perfdata:
@@ -45,11 +45,11 @@ parameters (dict): This check requires a dictionary with the following
keys.
Integer numbers are interpreted as remaining nonheap memory
Float numbers are interpreted as available nonheap memory usage
- {"totalheap"} - A pair of two values to be used as WARN/CRIT levels
- Integer numbers are interpreted as remaining totalheap memory
- Float numbers are interpreted as available totalheap memory usage
+ {"total"} - A pair of two values to be used as WARN/CRIT levels
+ Integer numbers are interpreted as remaining total memory
+ Float numbers are interpreted as available total memory usage
[configuration]
-jolokia_metrics_mem_default_levels (dict): Default warn/crit levels for heap, nonheap and
totalheap
+jolokia_metrics_mem_default_levels (dict): Default warn/crit levels for heap, nonheap and
total
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index b9143a5..0163283 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -167,7 +167,13 @@ def check_jolokia_metrics_mem(item, params, info):
# convert old parameter version ( warn, crit )
# represented levels of total heap
if type(params) == tuple:
- params = {"totalheap": params}
+ params = {"total": params}
+
+ # rename totalheap to total
+ # this block can be removed in the future (today 22.02.13)
+ if "totalheap" in params:
+ params["total"] = params["totalheap"]
+ del params["totalheap"]
d = parsed[item]
mb = 1024 * 1024.0
@@ -186,13 +192,13 @@ def check_jolokia_metrics_mem(item, params, info):
for (what, value, value_max) in [
("heap", heap, heapmax),
("nonheap", nonheap, nonheapmax),
- ("totalheap", total, totalmax),
+ ("total", total, totalmax),
]:
param_state = 0
level_info = ""
if params.get(what):
if type(params[what][0]) == int:
- if what != "totalheap":
+ if what != "total":
perfdata.append((what, value, value_max - params[what][0], value_max
- params[what][1], "", value_max))
if value_max - value <= params[what][1]:
param_state = 2
@@ -201,7 +207,7 @@ def check_jolokia_metrics_mem(item, params, info):
param_state = 1
level_info = "%s(warn at %sMB free)" % (state_sign[1],
params[what][0])
else:
- if what != "totalheap":
+ if what != "total":
perfdata.append((what, value, value_max * params[what][0] / 100.0,
value_max * params[what][1] / 100.0, "", value_max))
if value >= value_max * params[what][1] / 100.0:
param_state = 2