tags:

views:

402

answers:

3

Newbie in rrdtool. I want to look at efforts required to establish a line of best fit on RRD charts so that we can detect long term trends - i.e. value is increasing over time. I have been recently using the Perl module Statistics::LineFit to help establish regression trends. Maybe there is a tool in RRD itself which makes it easier to do a linear regression fit?

Looked at the PREDICT, PREDICTSIGMA documentations and tried below settings but this gives me below error. Any suggestions please.

rrdtool graph image.png --imgformat=PNG \
--start=-7days --end=+3days --width=1000 --height=200 --alt-autoscale-max \ DEF:value=value.rrd:value:AVERAGE:start=-14days \ 
LINE1:value#ff0000:value \ 
CDEF:predict=86400,-7,1800,value,PREDICT \ 
CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \ 
CDEF:upper=predict,sigma,3,*,+ \ 
CDEF:lower=predict,sigma,3,*,- \ 
LINE1:predict#00ff00:prediction \ 
LINE1:upper#0000ff:upper\ certainty\ limit \ 
LINE1:lower#0000ff:lower\ certainty\ limit \ CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \ 
TICK:exceeds#aa000080:1

ERROR

[ERROR: invalid rpn expression in: 86400,-7,1800,value,PREDICT]

+1  A: 

You might want to look at the PREDICT and PREDICTSIGMA functions in rrdtool 1.4 ... maybe they help.

Tobi Oetiker
Thanks Tobi, I have looked at the documents for PREDICT and PREDICTSIGMA bu getting error. I have updated my question with the progress. Can you please advise what I am doing wrong here.
Space
A: 

Good question. I'm also an RRD noob and I hope you get a good answer. My only comment from my experience is this:

Are you aware of the xport command? Having to make specific, custom use of my graph data, I finally just exported the data to XML, processing it externally. xport is very similar to graph except you get text instead of a graphic file.

I would hope it doesn't come to this, but in principle you could compute your line and superimpose it on the rrdtool graph using Imagemagick or something.

jhs
A: 

Google gave me this "Trend / Prediction with RRDtool". I am able to find the long term trends using the hints given on this page. Hope this is helpful for other as well.

Space