Run cacti every 1 minute instead of every 5 minutes?

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

Moderators: Developers, Moderators

Post Reply
sparkyflashpants
Posts: 7
Joined: Fri Aug 15, 2003 10:07 pm

Run cacti every 1 minute instead of every 5 minutes?

Post by sparkyflashpants »

Is it possible to run cacti more frequently? Like every minute instead of every 5 minutes? What configuration changes in cacti would I need to make?

I would want to have one additional graph per data source in addition to the existing four: An "hourly" graph that shows a few hours of stats at 1 min averages (plus the "daily", "weekly", "monthly", and "yearly" graphs).

Thanks!

RedHat 9
Cacti 0.8.2a
rrdtool 1.0.45
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

To do this you need to:

1) Configure cmd.php run every minute in cron.
2) Update each of the round robin archives by multiplying the "Step" by 5.
3) Add a new round robin archive (for hourly) with a step of 1 and 60 rows.
4) Change the "Step" for all of your data sources to '60'
5) Associate each one of your data sources with your new hourly round robin archive.
6) Delete all of your .rrd files so Cacti can re-create them.

-Ian
sparkyflashpants
Posts: 7
Joined: Fri Aug 15, 2003 10:07 pm

Post by sparkyflashpants »

Thanks for the reply!

There were a few other things that I found needed changing:
  • Page Refresh in user settings for each user
    The heartbeat for each data source item in the data source
    The associated RRA for each graph in the tree
I'm not sure what "Timespan" in the user settings does... Do I need to change it too?
raX wrote:5) Associate each one of your data sources with your new hourly round robin archive.
So I have several hundred data sources. They were all created using a data template. When I updated the step and heartbeat in the template, the changes propagated down to each one of my data sources. However, when I selected the hourly RRA in the associated RRA's for the template, the change did not propogate to all the data sources. Did I do something wrong? Is there a way I can push this change to all the data sources so that I don't have to do it one by one?

Also, each one of the tree items has an associated RRA (I'm guessing for preview purposes). I want to change all of those to the hourly view. Is there a way to change all the tree items at once rather than one at a time?

Thanks for your help!
sparkyflashpants
Posts: 7
Joined: Fri Aug 15, 2003 10:07 pm

Post by sparkyflashpants »

Whoa! So now the graphs are messed up. The daily graph shows five days, the weekly graph shows five weeks, the monthly graph shows five months, and the yearly graph shows five years. It looks like the --start parameter passed to rrdtool is 5 times too much. How can I fix this?

BTW, I figured out a quick hack to get the new RRA associated with all the data sources. I selected them all and changed the data template to the same thing it was set to before. That made them all re-read the associated RRA's from the template.

Now I just need to know how to change all the RRA's associated with the tree items and get this x5 problem resolved and I'll be all set!

Thanks!
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Check out the get_rra_timespan() function in 'include/functions.php'. This is the function that determines the --start for all graphs. Changing the 144 to 28 or something close to that should do the trick. The good news is that the next version will contain a 'timespan' field for each round robin archive so all of this will not be necessary.

-Ian
sparkyflashpants
Posts: 7
Joined: Fri Aug 15, 2003 10:07 pm

Post by sparkyflashpants »

Can I change it to 28.8 and then round after all the multiplications? I'm not familiar with php...

For example, do something like this:

Code: Select all

$timespan = -round($rra["rows"] * $rra["steps"] * 28.8);
Thanks!
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

That should work as long as the parser doesn't complain about the minus sign directly in front of your round() function.

-Ian
sparkyflashpants
Posts: 7
Joined: Fri Aug 15, 2003 10:07 pm

Post by sparkyflashpants »

Oh, I just figured out what that function is doing and why you have the 144 there. After I installed cacti, I noticed that there were 600 rows in the "daily" RRA but the daily graph only displays 24 hours (which is 288 5-minute increments, not 600). Multiplying by 300 (the default 5 minutes between runs) instead of 144 would make the daily graph display 50 hours in the daily graph rather than 24.

I think that the number in that multiplication should be 300 (or the 'timespan' variable you mentioned) instead of 144. Then, if the user wants the daily graph to show only 24 hours, he should just change the rows to 288. That way you're not storing a full 50 hours worth of data and only displaying 24 hours of it. It also makes more intuitive sense, I think. It makes it easier to create custom RRAs and predict how much information will be displayed on the associated graph. But that's just my opinion. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest