Module: check_mk
Branch: master
Commit: c613f44a8e3f488a79136d9c3aaf0008dd810df9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c613f44a8e3f48…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 26 11:25:43 2011 +0200
ps.perf: better error handling in PNP template
---
ChangeLog | 1 +
pnp-templates/check_mk-ps.perf.php | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8b6bb1c..a6bd942 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.1.12:
Checks & Agents:
* dell_powerconnect_*: final fixed, added PNP-templates
+ * ps.perf: better error handling in PNP template
Multisite:
* Dashboard: fix font size of service statistics table
diff --git a/pnp-templates/check_mk-ps.perf.php b/pnp-templates/check_mk-ps.perf.php
index 99661aa..3b468f8 100644
--- a/pnp-templates/check_mk-ps.perf.php
+++ b/pnp-templates/check_mk-ps.perf.php
@@ -39,7 +39,7 @@ $def[1] .= "GPRINT:count:MAX:\"Maximum\: $format \"
";
$def[1] .= "HRULE:$WARN[1]#FFFF00:\"Warning at $WARN[1]\" ";
$def[1] .= "HRULE:$CRIT[1]#FF0000:\"Critical at $CRIT[1]\" ";
-if ($DS[2]) {
+if (isset($DS[2])) {
$opt[2] = " --vertical-label \"MB\" -l 0 --title \"Memory
Usage\" ";
$def[2] = "DEF:vsz=$RRDFILE[2]:$DS[2]:MAX ";
$def[2] .= "DEF:rss=$RRDFILE[3]:$DS[3]:MAX ";
@@ -55,7 +55,7 @@ if ($DS[2]) {
$def[2] .= "GPRINT:rssmb:MAX:\"Max\: %5.1lf MB\" ";
}
-if ($DS[3]) {
+if (isset($DS[3])) {
$opt[3] = " --vertical-label \"CPU(%)\" -l 0 -u 100 --title \"CPU
Usage\" ";
$def[3] = "DEF:pcpu=$RRDFILE[4]:$DS[4]:MAX ";
$def[3] .= "AREA:pcpu#30ff80:\"CPU usage (%) \" ";