Hi,

Thanks to Ryan's suggestion I came up with the following:

Instead of using "rrdtool dump" which dumps the entire RRD and is hard to
process, I used "rrdtool fetch" and specified the correct time period to
select the appropriate RRA (I use +3months as I want at least 3 months of
white space on the right of the graph to see the trend lines):

rrdtool <rrd> fetch MAX -s -1y+3months

I then loop through the output to find the first non-NaN row and get the
time which is in the correct format for the RRA - let's call this $START.
If I don't find any NaN entries at the beginning then I don't need to
continue with this and I draw the graph normally.

I then pass the following to rrdtool:

rrdtool graph -s $START -e $START+1y ...

This then generates a graph which grows from the left with all the white
space at the right hand side. I can't seem to find any scenarios where this
approach doesn't work.

Thanks,
Chris
_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Reply via email to