[rrd-users] Time Shift on Trend Graph

Chris Mason chris at netnix.org
Tue Jul 2 21:51:11 CEST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130702/07e85371/attachment-0001.htm 


More information about the rrd-users mailing list