Holt-Winters functionality (forecasting) with Cacti

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

psyber wrote:Agreed, I have a presentation middle of next week I need to prep for. As soon as I get that off the hot list I'll check out 8.8 and see whats cooking. I know PREDICT works with very little tweaking.
No need to study 088. Please provide me with working examples and a view words on parameters and their interdependancies for "low hanging fruit". I'll do the coding, then
If there's VDEF in 8.7g I need to update (still running 8.7d) I'm a little reluctant though, I can't remember what all I did to get the functionality I have and I know there are some management types that would be unhappy if I broke what I have now.
Misunderstanding! VDEF is in 088, not in 087g!

R.
User avatar
psyber
Cacti User
Posts: 84
Joined: Tue Aug 02, 2005 7:18 pm

Post by psyber »

Hmm after looking at what I have for PREDICT, it should work out of the box. (provided you have a new enough RRDtool)
I just created a CDEF with the following

cdef=86400,-7,1800,CURRENT_DATA_SOURCE,PREDICT

(That sets the window at a day(60*60*24) and looks 7 windows back and takes a half hour (30*60) average)

Code: Select all

Item       Item           Value 	 
Item #1 	Custom String: 86400
Item #2 	Custom String: -7
Item #3 	Custom String: 1800 
Item #4 	Special Data Source: CURRENT_DATA_SOURCE 
Item #5 	Custom String: PREDICT
I think TREND and TRENDNAN work similarly but I haven't use them yet. You could add them as Functions or just do as I did and use Custom String.


The LSLINT/LSLSLOPE are only allowed in VDEFs so we need the VDEF support first

Code: Select all

'VDEF:A=avail,LSLSLOPE',
'VDEF:B=avail,LSLINT',
'CDEF:avg=avail,POP,A,COUNT,*,B,+',
'CDEF:ab=avg,90,100,LIMIT',
'VDEF:minab=ab,FIRST',
'VDEF:maxab=ab,LAST',
Last edited by psyber on Mon Jul 12, 2010 3:26 pm, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The PREDICT is easy, as you already found out. Supporting this requires changing of an array only. The other one may require more thinking.
I want to support this for Data Templates, using the GUI mechanics you already know.

What I need now is the full rrdtool command, a graph that shows the result and some few words on the results, how to read the graph.

That would make a first "use case". We may look at the variations, then. Are you able to provide what I request?
R.
User avatar
psyber
Cacti User
Posts: 84
Joined: Tue Aug 02, 2005 7:18 pm

Post by psyber »

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 :o

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.
Attachments
Original data set
Original data set
data5.png (28.24 KiB) Viewed 4278 times
Data set with LSL trending
Data set with LSL trending
data5_trend.png (35.63 KiB) Viewed 4278 times
artiflo
Cacti User
Posts: 76
Joined: Wed Dec 19, 2007 2:00 pm

Re: Holt-Winters functionality (forecasting) with Cacti

Post by artiflo »

I search to add this awesome feature (PREDICT forecast) to my cacti 0.8.7g.

How I can do that ? Someone may write a little howto for newbie guys like me ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Holt-Winters functionality (forecasting) with Cacti

Post by gandalf »

This is not yet supported by Cacti out of the box
R.
hattentodi
Posts: 2
Joined: Sat Feb 12, 2011 1:51 am

Re: Holt-Winters functionality (forecasting) with Cacti

Post by hattentodi »

Could anyone explain me about how to create graph prediction?
Now, I create graph (using script) to show value of performance of Apache tomcat.
And I have many problem about create prediction graph. I can't plot prediction graph which can plot navigate(in future) the real value.

Now, I have five graph like this
Image

I want to plot another line for predicting this like Mr. gilesc that the equation ( y=ax+b) can change all the time.
Thanks, Hattentodi.

*ps. sorry about my English-writing that so terrible.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Holt-Winters functionality (forecasting) with Cacti

Post by gandalf »

Holt-Winters is not yet supported by cacti. So you may want to create the correct "rrdtool graph" statement outside of cacti, referring to the rrd files maintained by cacti
R.
hattentodi
Posts: 2
Joined: Sat Feb 12, 2011 1:51 am

Re: Holt-Winters functionality (forecasting) with Cacti

Post by hattentodi »

Could you tell me about description in all step? (Sorry, I am a newbie)
But, I saw Mr. koaps explain step to add prediction graph with HWPREDICT and DEVPREDICT
May I have to add any plug-in or package for my Cacti




I use Cacti 0.8.7e with rrdtool 1.4
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Holt-Winters functionality (forecasting) with Cacti

Post by gandalf »

I am not aware of any plugin/add-on that adds this functionality. And to be honest, forecasting is the part of rrdtool I've never hit before. So all I can do is to advise reading the postings and search the net.
R.
gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am

Re: Holt-Winters functionality (forecasting) with Cacti

Post by gsaray101 »

any new info on this topic?
User avatar
psyber
Cacti User
Posts: 84
Joined: Tue Aug 02, 2005 7:18 pm

Re: Holt-Winters functionality (forecasting) with Cacti

Post by psyber »

I haven't spent much time with cacti lately. The stuff I have in production still works but upgrading will be next to impossible with all the tweaks I've had to make. Even at the OS level it's not something I could reproduce accurately. I have visions of what I'd like to do going forward but that silly work thing always gets in the way. When I fist posted stuff up here we only had about 600Tb spinning. Now I think we are over 1.5 Pb and rapidly approaching 2 Pb. Our staff has decreased by 2/3s. I've gone from just doing the monitoring to network engineering, systems provisioning, virtulization, storage managemnt, systems administration, systems archetecting, and a few other hats that get lost in the pile. A lot of the new storage stuff isn't even being inducted into cacti (We use a custom script and email to get the stats into cacti because the storage systems are so locked down and snmp has limits on space reporting)
Now a days we do things very different, we are using puppet to provision and manage systems. When the time comes for me to upgrade the system (that day is actually probably past at this point) I will be doing much of this work again and I will ingest some of the work that I did earlier. Since puppet pretty much documents the configuration of a system by defining its state I'll be able to provide better help on all the things that need to be done to make it all work and I'll probably be smarter about how I modify things so as to be able to patch upgrades or at least have a firm grasp on what needs changed. Until that time I can maybe answer specific questions but I highly advise any one really interested in trending with RRDtool to spent some time on the internet and flesh it out on their own. You will likely gain a much deeper understading of of how the different methods work than I could give you and you may discover some things that others haven't.

To the cacti devs, If you are interested in adding this sort of functionality please email me direct. I'd go to extra lengths to be available for you to pick my brain. It's in my best interest to get all this rolled into cacti so I don't have to maintain the code base (cuz its clear I can't and keep up with everything else I have on my plate) Plus in all likely hood your going to do a much beter job implementing and coding than I ever could.
artiflo
Cacti User
Posts: 76
Joined: Wed Dec 19, 2007 2:00 pm

Re: Holt-Winters functionality (forecasting) with Cacti

Post by artiflo »

That would be great if that could be added to cacti like Least Squares to.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests