So for the Least Squares stuff (LSLINT and LSLSLOPE) the best resource I've found is here:
http://hints.jeb.be/2009/12/04/trend-pr ... h-rrdtool/
I've taken what he has and modified the script a bit to work with some of our filesystem data.
Code: Select all
#! /usr/bin/perl
use lib '/usr/local/rrdtool-1.3.99909040100/lib/perl/5.8.8/x86_64-linux-thread-multi/';
use RRDs;
my $rrd_file = '/path/to/data.rrd';
#get first time in DS
my $start = RRDs::first ($rrd_file);
RRDs::graph "trend.png",
'--start', "5/1/2010",
'--end', "8/10/2010 00:00am",
'--title', "Disk % Util",
'--interlace', '--width=600', '--height=200',
"--color","ARROW#009900",
'--vertical-label', "used (%)",
'--lower-limit', '0',
'--watermark',"CRBS Operations",
"DEF:used1=$rrd_file:hdd_used:AVERAGE",
"DEF:used2=$rrd_file:hdd_used:AVERAGE:start=$start",
"DEF:used3=$rrd_file:hdd_used:AVERAGE:start=-1w",
"DEF:used4=$rrd_file:hdd_used:AVERAGE:start=-2w",
"DEF:used5=$rrd_file:hdd_used:AVERAGE:start=-4w",
"DEF:free1=$rrd_file:hdd_free:AVERAGE",
"DEF:free2=$rrd_file:hdd_free:AVERAGE:start=$start",
"DEF:free3=$rrd_file:hdd_free:AVERAGE:start=-1w",
"DEF:free4=$rrd_file:hdd_free:AVERAGE:start=-2w",
"DEF:free5=$rrd_file:hdd_free:AVERAGE:start=-4w",
"CDEF:pused1=used1,100,*,used1,free1,+,/",
"CDEF:pused2=used2,100,*,used2,free2,+,/",
"CDEF:pused3=used3,100,*,used3,free3,+,/",
"CDEF:pused4=used4,100,*,used4,free4,+,/",
"CDEF:pused5=used5,100,*,used5,free5,+,/",
"HRULE:100#FF000044",
"HRULE:99.5#FF000044",
"HRULE:99#FF000044",
"HRULE:98.5#FF000044",
"HRULE:98#FF000044",
"HRULE:97.5#FF000044",
"HRULE:97#FF000044",
"HRULE:96.5#FF000044",
"HRULE:96#FF000044",
"HRULE:95.5#FF000044",
"HRULE:95#FF000044",
"HRULE:94.5#FF000022",
"HRULE:94#FF000022",
"HRULE:93.5#FF000022",
"HRULE:93#FF000022",
"HRULE:92.5#FF000022",
"HRULE:92#FF000022",
"HRULE:91.5#FF000022",
"HRULE:91#FF000022",
"HRULE:90.5#FF000022",
"HRULE:90#FF000022",
"COMMENT: Now Min Avg Max\\n",
"AREA:pused1#008800AA:Used",
'GPRINT:pused1:LAST:%12.0lf%s',
'GPRINT:pused1:MIN:%10.0lf%s',
'GPRINT:pused1:AVERAGE:%13.0lf%s',
'GPRINT:pused1:MAX:%13.0lf%s' . "\\n",
"COMMENT: \\n",
'VDEF:D2=pused2,LSLSLOPE',
'VDEF:H2=pused2,LSLINT',
'CDEF:avg2=pused2,POP,D2,COUNT,*,H2,+',
'CDEF:abc2=avg2,90,100,LIMIT',
'VDEF:minabc2=abc2,FIRST',
'VDEF:maxabc2=abc2,LAST',
'VDEF:D3=pused3,LSLSLOPE',
'VDEF:H3=pused3,LSLINT',
'CDEF:avg3=pused3,POP,D3,COUNT,*,H3,+',
'CDEF:abc3=avg3,90,100,LIMIT',
'VDEF:minabc3=abc3,FIRST',
'VDEF:maxabc3=abc3,LAST',
'VDEF:D5=pused5,LSLSLOPE',
'VDEF:H5=pused5,LSLINT',
'CDEF:avg5=pused5,POP,D5,COUNT,*,H5,+',
'CDEF:abc5=avg5,90,100,LIMIT',
'VDEF:minabc5=abc5,FIRST',
'VDEF:maxabc5=abc5,LAST',
"AREA:abc2#FFBB0044",
"AREA:abc3#0077FF44",
"AREA:abc5#FF550044",
"LINE2:abc2#FFBB00",
"LINE2:abc3#0077FF",
"LINE2:abc5#FF5500",
"LINE1:avg2#FFBB00:overall trend :dashes=10",
"LINE1:avg3#0077FF:1 week trend\\n:dashes=10",
"GPRINT:minabc2: Reach 90% @ %c :strftime",
"GPRINT:minabc3: Reach 90% @ %c \\n:strftime",
"GPRINT:maxabc2: Reach 100% @ %c :strftime",
"GPRINT:maxabc3: Reach 100% @ %c \\n:strftime",
"LINE1:avg5#FF5500:1 month trend\\n:dashes=10",
"GPRINT:minabc5: Reach 90% @ %c \\n:strftime",
"GPRINT:maxabc5: Reach 100% @ %c \\n:strftime",
;
my $ERR=RRDs::error;
die "ERROR : $ERR" if $ERR;
There's actually defs in there for a 2 week and 3 week but I'm not using them. And as you can see from the projections I'm gonna know pretty quick how accurate the projections are
I think the output is pretty straight forward, depending on which trend you choose to believe we will run out of space July 17th, July 22, or July 28 or somewhere in that range. I wish I had a graph with some white space between the 100% mark and the current data but you get the general idea (the graph at the link has some white between last data and the 100% mark)
I did work out finally what bit of oddness I remembered running into with PREDICT. I'm using it with the aggregate plug-in and there's some serious CDEF magic going on in there (which is why I love Cacti)
I couldn't simply make a CDEF that used "Similar data sources no dupes" instead what I had to do was hard code the matching CDEF. i.e.
Code: Select all
CDEF:cdefdg=TIME,1279048252,GT,a,a,UN,0,a,IF,IF,TIME,1279048252,GT,c,c,UN,0,c,IF,IF,TIME,... trimmed...,+,+,+,+,+,+,+,+ \
CDEF:cdefdh=TIME,1279048252,GT,ba,ba,UN,0,ba,IF,IF,TIME,1279048252,GT,bb,bb,UN,0,bb,IF,IF,TIME, ... trimmed... ,+,+,+,+,+,+,+,+ \
CDEF:cdefdi=TIME,1279048252,GT,a,a,UN,0,a,IF,IF,TIME,1279048252,GT,c,c,UN,0,c,IF,IF,TIME,... trimmed...,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+\
CDEF:cdefdj=86400,-7,7200,cdefdg,PREDICT \
So I created a one time use CDEF 86400,-7,7200,cdefdg,PREDICT
I'm hoping you might have some thoughts on ways to do this right (my way will break when I add to the aggregate). I have a huge interest in the use case of forecasting across an aggregate. I think for us that makes more sense then looking at individual file systems. I'm not sure how the aggregate plug-in will change with the addition of VDEF I'm hoping to try out some of the LSL stuff on an aggregate, I just haven't had the time to code it up and see the results.