Search code examples
perlrrdtoolrrd

How can I find long term trends using RRD?


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]


Solution

  • 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.