<div dir="ltr">Hi,<div><br></div><div>Thanks to Ryan's suggestion I came up with the following:</div><div><br></div><div>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):</div>
<div><br></div><div style>rrdtool <rrd> fetch MAX -s -1y+3months</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>I then pass the following to rrdtool:</div><div style><br></div><div style>rrdtool graph -s $START -e $START+1y ...</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>Thanks,</div><div style>Chris</div></div>