Hi everybody, I still have my problem of discontinued results but for the moment I try to build some templates as i´m really not satisfied by the ones from PNP. So I almost finished one for the swap :
# # Template for check_swap # Cyril Vieville 25/03/2009 # # $warn = $MAX[1] - $WARN[1]; $crit = $MAX[1] - $CRIT[1]; $warn_pct= $warn * 100 / $MAX[1]; $crit_pct= $crit * 100 / $MAX[1]; $opt[1] = "-X 0 --vertical-label PERCENT -l 0 -u 100 --title \"Swap usage $hostname\" --color CANVAS#000000 --color BACK#101010 --color FONT#C0C0C0 --color MGRID#80C080 --color GRID#808020 --color FRAME#808080 --color ARROW#FFFFFF --color AXIS#FFFFFF --color SHADEA#C0C0C0 --color SHADEB#C0C0C0 "; $def[1] = "DEF:value=$rrdfile:$DS[1]:AVERAGE "; $def[1] .= "CDEF:current=$MAX[1],value,- "; $def[1] .= "CDEF:current_pct=current,100,*,$MAX[1],/ "; $def[1] .= "CDEF:good=current_pct,$warn_pct,GT,0,current_pct,IF "; $def[1] .= "CDEF:much=current_pct,$warn_pct,GT,current_pct,0,IF "; $def[1] .= "CDEF:toomuch=current_pct,$crit_pct,GT,current_pct,0,IF "; $def[1] .= "AREA:good#00FF00:\"Normal usage\" "; $def[1] .= "AREA:much#FFFF00:\"Exceeding warning threshold\" "; $def[1] .= "AREA:toomuch#FF0000:\"Exceeding critical threshold\\n\" "; $def[1] .= "LINE1:current_pct#FFFFFF: "; $def[1] .= "HRULE:$warn_pct#9900CC:\"Warning on $warn MB ( $warn_pct % )\" "; $def[1] .= "HRULE:$crit_pct#0000FF:\"Critical on $crit MB ( $crit_pct % )\\n\<file:///\\n\>" "; $def[1] .= "GPRINT:current:LAST:\"%9.2lf MB currently used \\n\<file:///\\n\>" "; $def[1] .= "GPRINT:current:MIN:\"%9.2lf MB min used \\n\<file:///\\n\>" "; $def[1] .= "GPRINT:current:MAX:\"%9.2lf MB max used \\n\<file:///\\n\>" "; $def[1] .= "GPRINT:current:AVERAGE:\"%9.2lf MB average used\" "; It works very fine but I just want to add some percentages on my graph. How can I get the percentage of the variables current:LAST, current:MIN, current:MAX, current:AVERAGE ? Another question : Is it possible to transform a PNP variable like current:LAST in a PHP variable ? Thank you for your help Cyril Viéville System Administrator
_______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
