Module: check_mk
Branch: master
Commit: 1beeafa48f089f9c033d9a6487390c05422ed121
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1beeafa48f089f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 17 11:57:44 2013 +0100
FIX jolokia_metrics.mem: PNP-Template now handles non existant max values
With some application servers the maximum values for memory are not provided
by the agent. The checks did already handle this, but the PNP graph could
not be displayed in this case.
---
.werks/380 | 12 ++++++++++++
ChangeLog | 1 +
pnp-templates/check_mk-jolokia_metrics.mem.php | 12 ++++++++----
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/.werks/380 b/.werks/380
new file mode 100644
index 0000000..3a487f0
--- /dev/null
+++ b/.werks/380
@@ -0,0 +1,12 @@
+Title: jolokia_metrics.mem: PNP-Template now handles non existant max values
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387277786
+Targetversion: future
+
+With some application servers the maximum values for memory are not provided
+by the agent. The checks did already handle this, but the PNP graph could
+not be displayed in this case.
diff --git a/ChangeLog b/ChangeLog
index b167301..1e3b68a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@
* 0345 FIX: Linux agent: fix detaching of background plugins...
* 0378 FIX: agent_vsphere.pysphere: Trying to deal with permissions only on some
guests/hosts
* 0245 FIX: Inline SNMP now longer throws an exception when using SNMPv3
credentials...
+ * 0380 FIX: jolokia_metrics.mem: PNP-Template now handles non existant max values...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/pnp-templates/check_mk-jolokia_metrics.mem.php
b/pnp-templates/check_mk-jolokia_metrics.mem.php
index 9454309..2f79096 100644
--- a/pnp-templates/check_mk-jolokia_metrics.mem.php
+++ b/pnp-templates/check_mk-jolokia_metrics.mem.php
@@ -31,16 +31,20 @@ $def[1] = ""
. "CDEF:min_nonheap=0,nonheap,- "
. "CDEF:total=heap,nonheap,+ "
- . "AREA:heap#00c0ff:\"Heap\" "
- . "LINE1:$MAX[1]#003077:\"Heap MAX\" ";
+ . "AREA:heap#00c0ff:\"Heap\" ";
+if ($MAX[1]) {
+ $def[1] .= "LINE1:$MAX[1]#003077:\"Heap MAX\" ";
+}
if ($CRIT[1]) {
$def[1] .= "LINE1:$WARN[1]#a0ad00:\"Heap WARN\" "
. "LINE1:$CRIT[1]#ad0000:\"Heap CRIT\" ";
}
-$def[1] .= "AREA:min_nonheap#3430bf:\"Nonheap\" "
- . "LINE1:-$MAX[2]#003233:\"Nonheap MAX \" ";
+$def[1] .= "AREA:min_nonheap#3430bf:\"Nonheap\" ";
+if ($MAX[2]) {
+ $def[1] .= "LINE1:-$MAX[2]#003233:\"Nonheap MAX \" ";
+}
if ($CRIT[2]) {
$def[1] .= "LINE1:-$WARN[2]#adfd30:\"Nonheap WARN\" "
. "LINE1:-$CRIT[2]#ff0080:\"Nonheap CRIT\" ";