[HOWTO] 0.8.7 and 1 minute polling

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Post Reply
Author
Message
denny
Posts: 14
Joined: Wed Oct 24, 2007 11:04 pm

[HOWTO] 0.8.7 and 1 minute polling

#1 Post by denny » Thu Oct 25, 2007 12:36 am

Ok, I've been beating my head on this...

I'm trying to do 1 minute polling with 0.8.7. I am relatively new to cacti, had previously been using 0.8.6j. I started working on 1 minute polling a few days before 0.8.7 was released. :-?

So, I've dumped everything and am starting afresh with 0.8.7.

I have a few questions about understanding the out of the box settings, and how to modify this for 1 minute polling operation. If you find them tiresome, please skip to the end of the post.


Out of the box, there is both a 5 minute RRA ["Daily (5 Minute Average)"] and a 1 minute RRA ["Hourly (1 Minute Average)"].

The 5 minute RRA ["Daily"] uses a step value of 1, which assuming the default polling interval of 5 minutes seems to make sense. The 1 minute RRA also uses a step value of 1, which seems to make sense if the polling interval is changed to 1 minute.

The 5 minute RRA ["Daily"] uses a timespan of 86400 [1 day], which seems to make sense. However, the 1 minute RRA ["Hourly"] uses a timespan of 14400 [4 hours], which doesn't make sense to me. Why is this?

The 5 minute RRA ["Daily"] allocates 600 rows, which assuming the default polling interval of 5 minutes would be a timespan of 50 hours. Why isn't the default number of rows for the 5 minute RRA 288 (24 hours)?

The same question applies to the rows in the "Weekly", "Monthly", and "Yearly" RRAs. They appear to allocate more than twice the number of rows needed.

The 1 minute RRA ["Hourly"] allocates 500 rows, which assuming a polling interval of 1 minute results in a timespan of 8.3 minutes. This would seem to wrap/overwrite very quickly Why wouldn't the default number of rows be 3600?

Am I just missing something basic on the math???

The timespan on the "Yearly" RRA is 33053184, which is 382.56 days. Why isn't the timespan 31536000 (or 31557600)?

---

So, with all the confusing background questions out of the way, the real question is how to set the RRAs up correctly for 1 minute polling?

Ignoring the default values at install, I would have assumed this:

Code: Select all

Name                        Steps     Rows    Timespan
Hourly (1 Minute Average)       1     3600        3600
Daily (5 Minute Average)        5    17280       86400
Weekly (30 Minute Average)     30    20160      604800
Monthly (2 Hour Average)      120    22320     2678400
Yearly (1 Day Average)       1440    21915    31557600
Yes, now that I write it out, the number of rows seems rather large. :o
I'm sure I've got some basic concept wrong, and I would appreciate someone correcting my math.

Thanks,

Denny
Last edited by denny on Thu Oct 25, 2007 3:53 am, edited 1 time in total.

jacauc
Posts: 34
Joined: Sun Sep 10, 2006 1:05 am

#2 Post by jacauc » Thu Oct 25, 2007 1:08 am

I am also very interested in this. Been struggling for days on end.
Subscribing to the thread

begemoti
Posts: 15
Joined: Tue Apr 03, 2007 6:05 am
Location: Gudauri, Georgia

#3 Post by begemoti » Thu Oct 25, 2007 3:05 am

Subscribing to the thread too

denny
Posts: 14
Joined: Wed Oct 24, 2007 11:04 pm

0.8.7 and 1 minute polling

#4 Post by denny » Thu Oct 25, 2007 4:02 pm

With the dawn comes light :)

The number of rows is off by a factor of the polling interval. The minimum number of rows should be:

Code: Select all

Name                        Steps     Rows    Timespan
Hourly (1 Minute Average)       1       60        3600
Daily (5 Minute Average)        5      288       86400
Weekly (30 Minute Average)     30      336      604800
Monthly (2 Hour Average)      120      372     2678400
Yearly (1 Day Average)       1440      366    31557600
Anything above these levels would offer greater precision for a longer range of time. However the additional precision is outside the default range of the corresponding graph.

The default values for the rows (other than the "Hourly") appear to be 2X the minimum, plus some rounding factor. So, does anyone know the logic in choosing rounding factor?

Thanks,

Denny

User avatar
TheWitness
Developer
Posts: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#5 Post by TheWitness » Thu Oct 25, 2007 9:03 pm

It is good that you all perform this exercise so that in the future you understand how Tobi's excellent product works.

We have only introduced this feature in 0.8.7 as a teaser. In future releases, we will be improving things more. You can modify the values as you see fit. It's better to add new ones though. For example, I know customers that keep 5 minute data for 6 months. This makes for big RRD files, but excellent graphs.

When you all see the light, I am sure you will be satisfied with the output. In the mean time, my only recommendation is that you play on a system that can be rebuilt and then once done, move into the big time production boxes.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

denny
Posts: 14
Joined: Wed Oct 24, 2007 11:04 pm

#6 Post by denny » Fri Oct 26, 2007 11:13 pm

Witness, can you offer comment on how the 2x + rounding amount was chosen?

Thanks,

Denny

User avatar
TheWitness
Developer
Posts: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#7 Post by TheWitness » Sat Oct 27, 2007 3:41 am

I believe it was rooted in Tobi's MRTG.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

david(dallas)
Posts: 9
Joined: Thu Nov 01, 2007 10:17 am

problems getting 1 minute intervals on graphs

#8 Post by david(dallas) » Thu Nov 01, 2007 10:47 am

I upgraded from 6j to 7. Was getting 5-minutes on 6j host graphs. I upgraded, selected 1 minute internal and change cron to 1 minute.
Graphs still displaying at 5-minutes. I was trying to see if I need to select a different graph or deleting adn re-add back a host to get the 1-minute internal graphs working, but no luck so far.
I would be greatly if someone could fill me in on what I not doing after my upgrade to get the 1 minute working.

Thanks in advance..

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

#9 Post by gandalf » Thu Nov 01, 2007 12:30 pm

Please see posts above discussing th erequired rra settings. You will at least have to change every existing rrd file to get it adjusted accordingly. Please be warned. This is no easy task. That's why we almost removed this feature from 087.
It is fine to adjust all rra's as mentioned above when doing a fresh start, deleting all existing rrd files
Reinhard

david(dallas)
Posts: 9
Joined: Thu Nov 01, 2007 10:17 am

#10 Post by david(dallas) » Thu Nov 01, 2007 2:26 pm

Since my last posting, I basicly did a reinstall as a new system with using no old RRA. I thought I would give that a shot. So from a fresh install, is it the casti.sql script that needs to be updated with the new rows/timespan counts shown above. Then I update sqlplus with the new data. Then when I create new host and graphs, it will start using the new numbers?

david(dallas)
Posts: 9
Joined: Thu Nov 01, 2007 10:17 am

#11 Post by david(dallas) » Thu Nov 01, 2007 3:32 pm

I might have figured out what you meant now, but still graphing at 5 minutes. I did update the Data Sources - RRA's to match the above numbers in Denny's last posting..

Name Steps Rows Timespan**
Hourly (1 Minute Average) 1 60 3600
Daily (5 Minute Average) 5 288 86400
Weekly (30 Minute Average) 30 336 604800
Monthly (2 Hour Average) 120 372 2678400
Yearly (1 Day Average) 1440 366 31557600

david(dallas)
Posts: 9
Joined: Thu Nov 01, 2007 10:17 am

#12 Post by david(dallas) » Thu Nov 01, 2007 3:35 pm

Data Sources Poller interval still shows 5 minutes even though I changed Settings -> Poller -> Interval -> 1 minute. Are these 2 different things?

Name** Data Input Method Poller Interval Active Template Name
srvalph2-um1 - CPU Usage - Nice Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - Nice
srvalph2-um1 - CPU Usage - System Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - System
srvalph2-um1 - CPU Usage - User Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - User
srvalph4 -dm1 - CPU Usage - Nice Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - Nice
srvalph4 -dm1 - CPU Usage - System Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - System
srvalph4 -dm1 - CPU Usage - User Get SNMP Data 5 Minutes Yes ucd/net - CPU Usage - User

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

#13 Post by gandalf » Fri Nov 02, 2007 5:18 am

david(dallas) wrote:I might have figured out what you meant now, but still graphing at 5 minutes. I did update the Data Sources - RRA's to match the above numbers in Denny's last posting..

Name Steps Rows Timespan**
Hourly (1 Minute Average) 1 60 3600
Daily (5 Minute Average) 5 288 86400
Weekly (30 Minute Average) 30 336 604800
Monthly (2 Hour Average) 120 372 2678400
Yearly (1 Day Average) 1440 366 31557600
Well done. But please be aware, that those changes only apply to fresh rrd files. Existing ones have to be tweaked to mimic this behaviour. We are aware of the fact, that currently the support is at basic level only. A major revamp is planned for 088.
Reinhard

denny
Posts: 14
Joined: Wed Oct 24, 2007 11:04 pm

#14 Post by denny » Mon Nov 05, 2007 7:13 am

For those of you who are interested, the following is what I ended up with:

Code: Select all

Name               Steps     Rows    Timespan 
1 Minute Average       1     4320       28800 
5 Minute Average       5     4320      604800 
30 Minute Average     30     4320     2678400 
6 Hour Average       360     4320    31536000 
You will notice that I've removed the "Hourly", "Daily", "Weekly" and such from the RRA names. This represents the most important lesson that I learned from the exercise: The timespan for the default graphs have no relationship to the timespan of the RRA themselves. The combining of RRA configuration and default graph duration in the UI looks to be a carryover from the early days of MRTG. These concepts really should be separated in the configuration.

So, what do the above numbers mean?

Data will be kept for:
3 days with a granularity of 1 minute (4320 * 60 seconds)
15 days with a granularity of 5 minutes (4320 * 300 seconds)
90 days with a granularity of 30 minutes (4320 * 1800 seconds)
1080 days with a granularity of 6 hours (4320 * 21600 seconds)

Default graphs will be displayed as:
8 hours
7 days
31 days
365 days

It should be noted that once the RRD is created, you cannot change the RRAs without tweaking or removing the RRD files as Gandalf noted. However you can change the default graph duration ("Timespan" in the UI) as this does not affect the RRAs.

Be aware that the number of rows that I have chosen is somewhat large. I do not have huge numbers of devices that I am monitoring, and I have available disk space. To put this in context, the RRD files for just interface traffic are half a meg each. That's 25MB for traffic in/out on a 48 port switch, and another 50MB if you also want to track errors in/out. Use care in selecting how much data you want to hold.

Denny

david(dallas)
Posts: 9
Joined: Thu Nov 01, 2007 10:17 am

still can't get 1 minute graph interval :(

#15 Post by david(dallas) » Mon Nov 05, 2007 5:55 pm

I have changed the rrd per postings, change the cron to 1 minutes and change the settings interval to 1 minute, but yet I continue to get displays at 5-minute intervals. TOTALLY AT A LOSS...
Attachments
cacti-graph.doc
(179.5 KiB) Downloaded 2960 times
cacti-rra.doc
(161 KiB) Downloaded 3291 times
cacti-settings.doc
(212.5 KiB) Downloaded 3628 times

Post Reply