Module: check_mk
Branch: master
Commit: 9a1dd6012f949f787217e80911bb208ec07732a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a1dd6012f949f…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Oct 24 14:53:07 2013 +0200
FIX: missing $maxgb added and better formatting (thanks to Daniel Roettgermann)
---
pnp-templates/check_mk-statgrab_mem.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pnp-templates/check_mk-statgrab_mem.php
b/pnp-templates/check_mk-statgrab_mem.php
index 69f30d2..7ee89dc 100644
--- a/pnp-templates/check_mk-statgrab_mem.php
+++ b/pnp-templates/check_mk-statgrab_mem.php
@@ -25,14 +25,17 @@
$opt[1] = "--vertical-label 'MEMORY(MB)' --upper-limit " . ($MAX[1] *
120 / 100) . " -l0 --title \"Memory usage $hostname\" ";
+$maxgb = sprintf("%.1f", $MAX[1] / 1024.0);
+
$def[1] = "DEF:ram=$RRDFILE[1]:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:swap=$RRDFILE[2]:$DS[2]:AVERAGE " ;
$def[1] .= "DEF:virt=$RRDFILE[3]:$DS[3]:AVERAGE " ;
$def[1] .= "HRULE:$MAX[3]#000080:\"RAM+SWAP installed\" ";
-$def[1] .= "HRULE:$MAX[1]#2040d0:\"RAM installed\" ";
+$def[1] .= "HRULE:$MAX[1]#2040d0:\"$maxgb GB RAM installed\" ";
$def[1] .= "HRULE:$WARN[3]#FFFF00:\"Warning\" ";
$def[1] .= "HRULE:$CRIT[3]#FF0000:\"Critical\\n\" ";
+$def[1] .= "'COMMENT:\\n' " ;
$def[1] .= "AREA:ram#80ff40:\"RAM used \" " ;
$def[1] .= "GPRINT:ram:LAST:\"%6.0lf MB last\" " ;
$def[1] .= "GPRINT:ram:AVERAGE:\"%6.0lf MB avg\" " ;