Create Cacti Polling Every Minute

Cacti and 1-minute polling


You should really, really get your Cacti RRA settings right before you begin using it. Cacti defaults to polling every 5 minutes, but a lot of enterprise users change this to 1 minute in order to provide higher resolution for troubleshooting problems. Unfortunately, there is a lot of incomplete information on how to do this.

The first link is mostly right, but forgets about adjusting RRA steps. Twopacket’s guide is very nearly correct, but warns against changing cron’s poller interval, which is exactly what you should do.

This is another post in my recent series on Cacti. In fact, I’ve written quite a lot about about Cacti.

1-Go to edit RRAs
go on web browser Cacti, under “Console” -> “Management” heading -> “Data Sources” -> RRAs.

and edit like so:

2-Adjust “Step” and “Heartbeat” on all Data Source templates

On your Cacti web interface - Console > Data Templates  Click on a Data Template you wish to use 1-minute polling.

3-Under “Associated RRAs”, select the new 1-minute RRAs you created with ctlc key
and then 
+Change the template "step" to 60 (this is in seconds = this is already the 1 minute polling interval)
+Change "heartbeat" to 120 for both traffic_in and traffic_out and save


4. Go to Console > Cacti Settings > Poller tab
5. Change the Poller Interval and Cron Interval to "Every Minute" and save


6-On Console > Utilities , click on Rebuild Poller Cache
7-Change the poller frequency in cron

Unfortunately it’s possible to configure cron several ways. Under Debian/Ubuntu, cacti installs a configuration file /etc/cron.d/cacti. From a terminal, edit it with:

#sudo editor /etc/cron.d/cacti


Source installs recommending editing root’s crontab.

#sudo crontab -e -u root

The entry will look something like this:

*/5 * * * * cactiuser php /var/www/cacti/poller.php >/dev/null 2>/var/log/cacti/poller-error.log

then change to

* * * * * cactiuser php /var/www/cacti/poller.php >/dev/null 2>/var/log/cacti/poller-error.log

#systemctl restart apache2
#systemctl restart mysql

NOTE: if we change cacti polling from 5min to 1min, cacti will work only new create graph so old graph that polling 5min will not work so we need to recreate graph again.

after change polling cacti to 1min sometime graph will not refresh auto for graph and weathermap page so we will use script code for reload page auto by:

that scrip will reload page on weathermap page every 10sec
by add in file:
#vim /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php
add this line:

[........]
default:
        include_once($config["base_path"]."/include/top_graph_header.php");
        print "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\n";
        print "<script type=\"text/javascript\" src=\"overlib.js\"><!-- overLIB (c) Erik Bosrup --></script> \n";
?>
<script>
setTimeout(function(){
    location.reload();
},10*1000);
</script>

<?php
[........]
save and exit.
reload page again.

How to use poller type with spine
============================