<?php
#
#
$opt[1] = "--vertical-label \"Memory [%]\" -u 100 -l 0 -r --title \"Memory Usage for $hostname / $servicedesc\" ";
#
#
#
$def[1] = "DEF:used=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:free=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "DEF:buffers=$rrdfile:$DS[3]:AVERAGE " ;
$def[1] .= "DEF:cache=$rrdfile:$DS[4]:AVERAGE " ;
#$def[1] .= "HRULE:$WARN[1]#FFFF00 ";
#$def[1] .= "HRULE:$CRIT[1]#FF0000 ";
$def[1] .= "CDEF:used-prc=used,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:free-prc=free,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:buffers-prc=buffers,100,*,$MAX[1],/ " ;
$def[1] .= "CDEF:cache-prc=cache,100,*,$MAX[1],/ " ;
$def[1] .= "COMMENT:\"\\t\\t\\t\\tLAST\\t\\t\\tAVERAGE\\t\\tMAX\\n\" " ;
$def[1] .= "AREA:used-prc#DC0000:\"Used\\t\" " ;
$def[1] .= "GPRINT:used-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:used:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:used:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:used:MAX:\"%6.2lf MB\\n\" " ;
$def[1] .= "AREA:buffers-prc#00F000:\"Buffers\\t\":STACK " ;
$def[1] .= "GPRINT:buffers-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:buffers:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:buffers:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:buffers:MAX:\"%6.2lf MB\\n\" ";
$def[1] .= "AREA:cache-prc#00A100:\"Cached\\t\":STACK " ;
$def[1] .= "GPRINT:cache-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:cache:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:cache:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:cache:MAX:\"%6.2lf MB\\n\" ";
$def[1] .= "AREA:free-prc#006800:\"Free\\t\":STACK " ;
$def[1] .= "GPRINT:free-prc:LAST:\"%6.2lf %%\" " ;
$def[1] .= "GPRINT:free:LAST:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:free:AVERAGE:\"%6.2lf MB\\t\" " ;
$def[1] .= "GPRINT:free:MAX:\"%6.2lf MB\\n\" " ;
$def[1] .= "LINE0.5:used-prc#000000: " ;
$def[1] .= "LINE0.5:buffers-prc#000000::STACK " ;
$def[1] .= "LINE0.5:cache-prc#000000::STACK " ;
$def[1] .= "LINE0.5:free-prc#000000::STACK " ;
?>