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

cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

I just realized I don't work with cacti often enough. Every time I find a new function I need/like I have to learn everything over again. Now I struggle with a graph template and RRAs (again!) to get it the way it needs to be.

/Carl
gilesc
Posts: 21
Joined: Thu Feb 07, 2008 4:01 am

Example

Post by gilesc »

This example is just more data of the other RRA.

You can see the confidence bands are well trained for a 24 hour season, but they get confused at the weekend.

Hope to have another graph of a different datasource available tomorrow or the day after.

It should have prediction & confidence bands for both incoming and outgoing traffic.
Attachments
Example of Holt-Winters on weekly graph.
Example of Holt-Winters on weekly graph.
hw-update.png (57.03 KiB) Viewed 9619 times
gilesc
Posts: 21
Joined: Thu Feb 07, 2008 4:01 am

Nagios Integration

Post by gilesc »

Here's an example of alerting (not using Cacti thresholds, but Nagios). The Window Length is 9 and the failure threshold is 6. Delta pos and delta neg, I believe, are the number of standard deviations away from the predicted value to trigger an alert (same as our confidence bands), you can see the raw FAILURES data below.

Example Dump of RRA, showing failures:

<params>
<delta_pos> 2.0000000000e+00 </delta_pos>
<delta_neg> 2.0000000000e+00 </delta_neg>
<window_len> 9 </window_len>
<failure_threshold> 6 </failure_threshold>

...snip...

<!-- 2008-03-11 13:40:00 CET / 1205239200 --> <row><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>
<!-- 2008-03-11 13:45:00 CET / 1205239500 --> <row><v> 1.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>
<!-- 2008-03-11 13:50:00 CET / 1205239800 --> <row><v> 1.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>
<!-- 2008-03-11 13:55:00 CET / 1205240100 --> <row><v> 1.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>
<!-- 2008-03-11 14:00:00 CET / 1205240400 --> <row><v> 1.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>
<!-- 2008-03-11 14:05:00 CET / 1205240700 --> <row><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v></row>


Here are the Email's from Nagios notifying about the abberant behaviour and the restoration of normal traffic:

Code: Select all

Notification Type: PROBLEM

Service: Cacti - Test Bandwidth
Host: Cacti
Address: 192.168.1.1
State: WARNING

Date/Time: Tue Mar 11 13:47:36 CET 2008

Additional Info:

WARNING Inbound - Current BW in: 16.71Mbps Out: 22.04Mbps
Email from Nagios giving resolution of problem:

Code: Select all

Notification Type: RECOVERY

Service: Cacti - Test Bandwidth
Host: Cacti
Address: 192.168.1.1
State: OK

Date/Time: Tue Mar 11 14:06:12 CET 2008

Additional Info:

OK - Current BW in: 15.05Mbps Out: 21.58Mbps
Hope this might be a little useful to some.
Attachments
check_rrdtraf2.sh
This rrdtraf script has been further modified to get the predicted value and standard deviations and display the expected range when a WARNING state occurs for Holt-Winters.
(12.15 KiB) Downloaded 337 times
check_rrdtraf.sh
Check rrdtraf script, modified to accept Holt-Winters failures RRA as option. Original script was written by Israel Brewster, who took it from Garry W. Cook
(11.48 KiB) Downloaded 295 times
Clip of the graph, graffically showing the aberrant behaviour.
Clip of the graph, graffically showing the aberrant behaviour.
clip-of-graph.png (8.76 KiB) Viewed 9610 times
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

Awesome graph, gilesc. Thanks to you, I have resumed my experimentation with HW :D. About the problem I wrote about in my previous post. If you look at wind_weekly.png and wind_weekly2.png (about 12 hours later), you see that the old data just disappears! Do you have any clue why this is?
Attachments
wind_weekly.png
wind_weekly.png (32.01 KiB) Viewed 9582 times
wind_weekly2.png
wind_weekly2.png (31.79 KiB) Viewed 9582 times
gilesc
Posts: 21
Joined: Thu Feb 07, 2008 4:01 am

Post by gilesc »

sveioen wrote:Awesome graph, gilesc. Thanks to you, I have resumed my experimentation with HW :D. About the problem I wrote about in my previous post. If you look at wind_weekly.png and wind_weekly2.png (about 12 hours later), you see that the old data just disappears! Do you have any clue why this is?
That's interesting...

I can't say what causes it, but I reckon that the answer would be displayed somewhere in the XML in a "rrdtool dump file.rrd" command. Perhaps the data source has been truncated in size for some reason. Unfortunately I don't think the rrd_hwreapply perl script is perfect, and can have difficulties with some RRD files, it's also not really been developed on for a few years or so. I'm no perl, nor XML guru... but I'm hoping there's enough people watching this thread with enough interest to provide solutions to the problems.

As an aside, I reckon that there is real money to be made in a "catch all" rrd manipulation tool with a GUI interface... these kind of problems could be resolved real quickly.

Anyway, I'll take the opportunity to attach a screenshot of my latest graph, our data source behaviour was changed recently (just under a week ago) so the predictions and confidence bands are not ideal (yet) - the season is a 2016 weekly, but it's nice enough to post to the forum.
Attachments
Holt-Winters Example
Holt-Winters Example
Clipboard01.png (138.91 KiB) Viewed 9566 times
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

Ok, I have just found out what I have been doing wrong( :oops: ). For every update on the rrd-files (those with no HW), I have been using rrd_hwreapply and made HW-able-copies. So I have made a "new clean" HW-rrd every time with minimum HW-data. It never occured to me that this is a script you run only once to initiate the HW-stuff, and then update the new file the normal way.

At least its working now! :P

gilesc: Love the graph :wink:
Attachments
real_weekly.png
real_weekly.png (33.67 KiB) Viewed 9487 times
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

Code: Select all

TICK:fail#ffffa0:1.0:"Feil\n" \
Added TICK :).
Attachments
real_weekly.png
real_weekly.png (49.23 KiB) Viewed 9458 times
gilesc
Posts: 21
Joined: Thu Feb 07, 2008 4:01 am

Post by gilesc »

sveioen wrote:

Code: Select all

TICK:fail#ffffa0:1.0:"Feil\n" \
Added TICK :).
OK - I want this :wink: - is that within Cacti, or is it a graph custom made from the RRD....
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

gilesc wrote:
sveioen wrote:

Code: Select all

TICK:fail#ffffa0:1.0:"Feil\n" \
Added TICK :).
OK - I want this :wink: - is that within Cacti, or is it a graph custom made from the RRD....
It is a graph custom made from the RRD. It's actually really simple to add the TICK-thing. Just add:

Code: Select all

DEF:fail="/blabla/bla/windhw.rrd":wind:FAILURES \
TICK:fail#ffffa0:1.0:"Feil\n" \
Ref.: http://www.usenix.org/events/lisa2000/f ... tlag_html/
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

TICK is not (yet) supported by cacti. But IF we will integrate HW, perhaps we'll add TICK as well. Not earlier than 088, for sure
Reinhard
gilesc
Posts: 21
Joined: Thu Feb 07, 2008 4:01 am

Post by gilesc »

Here's another iteration of the graph I showed before.

This is a Cacti RRD, but the RRA was generated with the TICK entry outside of Cacti. The same graph exists in the Cacti interface without the TICK entry.

Also - the weekly graph, which is looking pretty good now.
Attachments
Cacti RRD with Holt-Winters, generated outside of Cacti to add the TICK entry.
Cacti RRD with Holt-Winters, generated outside of Cacti to add the TICK entry.
my-graph.png (78.14 KiB) Viewed 9275 times
Weekly Graph
Weekly Graph
weekly.PNG (95.23 KiB) Viewed 9275 times
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

Very nice. One thing though, in the lower graph gilesc, the real value is way off the lower confidence band, still no TICK is drawn?

And; I know I should know this, but exactly what can a HW-graph tell you? I know it is supposed to give a predicted value based on previous data (right?), but here we just have a predicted value and the real value graphed at the same time, so you cant really call it a forecast. Or I am missing something?
cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

sveioen wrote:Very nice. One thing though, in the lower graph gilesc, the real value is way off the lower confidence band, still no TICK is drawn?

And; I know I should know this, but exactly what can a HW-graph tell you? I know it is supposed to give a predicted value based on previous data (right?), but here we just have a predicted value and the real value graphed at the same time, so you cant really call it a forecast. Or I am missing something?
It is a predicted value of what it should be based on previous values. And therefor when it is not within the predicted parameters, you might be having some weird stuff going on in your network that someone might want to look into :) Not sure if it can be used to predict your bandwidth requirements next year :lol:

/Carl
sveioen
Posts: 28
Joined: Sat May 28, 2005 2:58 pm

Post by sveioen »

cwahlin wrote:Not sure if it can be used to predict your bandwidth requirements next year :lol:

/Carl
Didn't think so :lol:.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

cwahlin wrote:It is a predicted value of what it should be based on previous values. And therefor when it is not within the predicted parameters, you might be having some weird stuff going on in your network that someone might want to look into :)
With that in mind, does rrdtool's implementation have any way to communicate with the outside world (e.g. PRINT) so that you could have some sort of alerting? What you *really* want is a report that shows links that are "a bit funny" so you can look at them. If you have to go and look at each graph to do that, well, you're looking at each graph so what's the point? :-)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests