Saturday, November 26, 2011

Cacti > 1 Minute Polling Using Spine

Just this morning, after about a week working on how to make my Cacti system poll every minute, I finally pulled it off. The procedure was simple but a bit long, I did only adjustment the cron jobs and series of configuration on Cacti's web interface.

Here are my general procedure on how I make it work

1. Edit cron to run /var/www/cacti/poller.ph every minute

#crontab -e

*/1 * * * * php /var/www/cacti/poller.php > /dev/null 2>&1

2. On your Cacti web interface - Console > Data Templates


3. Change the template "step" to 60 (this is in seconds = this is already the 1 minute polling interval)
4 Change "heartbeat" to 120 for both traffic_in and traffic_out and save


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


7. On Console > Utilities , click on Rebuild Poller Cache
8. You can also run php poller.php on your cacti folder

#php poller.php 

9. Verify if your cron is working by checking the cacti.log



10. On Console > Data Sources > RRAs, define the number of rows you want to maintain a 1 minute data
11. Create a new graph using the "Interface Traffic" template, so will see that your graph will display a 1 minute worth of data gathered.


Note: For those existing graph with 5-min polling interval, you need to re-create the graph or just simply delete the associated rrd files, thus losing your historical data.

Cheers!!!.. for now I will go out and celebrate my self!.. :)


Related Posts:
 - Setting-up your RRAs
 - Installing Spine
 - 1 minute polling drawback

15 comments:

  1. Hi Bro,

    Nice to meet you. I've a question for you about polling interval. If I setup follow your guide, it'll effect to all exist interfaces on cacti monitoring?
    --> increase performance monitoring equipments and server
    Do you have solution for change polling interval for some require interface only? not all

    ReplyDelete
    Replies
    1. how to fix cacti spine poller error | SOLVED Spine Poller errors
      https://youtu.be/e6wbzwy7wuo

      Delete
  2. Hi, yes, it will affect all interfaces that are using the "Interface - Traffic" data template... my suggestion is to create a duplicate and name it into "Interface - Traffic - 1 min". Then you can use the new template for those interfaces that you require to graph by 1 minute.

    ReplyDelete
  3. Hi,

    Excellent Tip. Can you tell me whether this can be used for selective polling? Meaning that I have a few critical hosts which I would like to poll every 1 min but others for which the default 5 mins is fine. How do I do that?

    ReplyDelete
    Replies
    1. hi star, thanks for dropping by

      I have exactly same requirements before, unfortunately, it is not possible. poller.php polls ALL host every time it runs, and follows the schedule set on your cron. There is no option where we can poll specific host. Hopefully this feature will be included on the future version and it could be a great optimization especially for those with large networks.

      Delete
  4. Wow thanks for your post. I've been reading the Cacti documentation and it is rubbish! There's lots telling you what stuff is, but nothing that says how to use it.
    I've got my polling down to a minute thanks to you.
    Now I just need to figure out why all my graphs are empty :(

    ReplyDelete
    Replies
    1. thanks djn,

      you need to sync your system time and hardware clock to your local time, and next is you have rebuild all your graphs. As with my case, I created a parallel 1 minute graph and let it run for about a month before I permanently remove my previous 5 minute graph.

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Hi,

    Very useful posted.
    Do you have any other posting on near year?

    Best Regards,

    ReplyDelete
  7. Will this work with the Unix-Ping host data template.

    ReplyDelete
  8. hi how are u, plz help me my cacti dont show me graph ,and all interface of routers are UP what can i do plz

    ReplyDelete
  9. Thanks man. Your save my skin!

    ReplyDelete
  10. I am using Cacti0.8.8a with default polling interval and cron interval of 1 minutes. I have 200 devices added for monitoring. If I use default 1 minute polling interval then I receive SPINE TimeOut errors.
    05/06/2017 02:09:02 PM - SPINE: Poller[0] ERROR: Spine Timed Out While Processing Hosts Internal
    05/06/2017 02:09:01 PM - POLLER: Poller[0] WARNING: There are '1' detected as overrunning a polling process, please investigate

    And some devices remain in UNKOWN state. So I changed it to 5 minutes again and SPINE error issue was solved.

    So what should I use 1 minute or 5 Minutes. Please suggest?

    ReplyDelete