brandon.pal wrote:NO graph for percutil.
I think you've got a simple typo. You've defined $opt[5] and $def[5] whereas they should be $opt[7] and $def[7]
brandon.pal wrote:Why is my graph completely messing up the numbers.
I've played around with templates and I understand your frustrations. Some of the documentation out there doesn't explain what I am about to say so it may not be correct but you'll know once you play around with my suggestion.
Comparing the data:
Code: Select all
Performance Data: ws=0.40
Graph Data: ws=470.67 mB CUR
And here is the corresponding code:
Code: Select all
$def[2] .= "DEF:ws=$rrdfile:$DS[4]:AVERAGE " ;
$def[2] .= "LINE:ws#FFCC00:\"Write \" ";
$def[2] .= "GPRINT:ws:LAST:\"%3.2lf %sB CUR \" ";
$def[2] .= "GPRINT:ws:MAX:\"%3.2lf %sB MAX \" ";
$def[2] .= "GPRINT:ws" . ':AVERAGE:"%3.2lf %sB AVG \j" ';
When the graph draws the lines and prints the legend, it is taking the values from within the RRD Database. By this time they have already been averaged out (based on the timeframe you are pulling data from). They will never be the same as the original perdata UNLESS the values remain constant (like cpu count of 4 across the whole graph, the max, current and average will always be the same).
To get the LAST value we can draw this from the XML file, as it records everything from the last performance data string returned. Specifically I am talking about the ACT field:
$ACT[4] relates to the ACT field in the XML file for the 4th datasource.
So instead of:
Code: Select all
$def[2] .= "GPRINT:ws:LAST:\"%3.2lf %sB CUR \" ";
Do:
Code: Select all
$def[2] .= "GPRINT:$ACT[4]:\"%3.2lf %sB CUR \" ";
Let me know if this makes sense / helps / works.