Pupose of Poller Cronjob in Cacti

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
pradeeps
Posts: 36
Joined: Tue Apr 23, 2019 7:56 am

Pupose of Poller Cronjob in Cacti

Post by pradeeps »

Hello Folks,

I am using cacti 0.8.8h version running on a centos-7 box. Recently, I started noticing loads of processes running on the box which increases the cpu-load.Considering the number of devices (~7.5k) this might be normal. However I am seeing hundreds of postdrop,sendmail, "poller.php --debug" process. Digging further I see this cronjob,

Code: Select all

*/5 * * * *     cacti   /usr/bin/php /usr/share/cacti/poller.php --debug > /dev/shm/poller.out
This might contribute the load hike. My question is, I have configured the poller process through cacti GUI under "Poller" tab and was thinking that will take care of the polling process. If thats true, is it safe to disable the above cronjob?
mmccaugh
Cacti User
Posts: 100
Joined: Mon Apr 09, 2018 1:37 pm

Re: Pupose of Poller Cronjob in Cacti

Post by mmccaugh »

No the cron job is what actually runs the poller, if you remove it nothing will actually run.
pradeeps
Posts: 36
Joined: Tue Apr 23, 2019 7:56 am

Re: Pupose of Poller Cronjob in Cacti

Post by pradeeps »

Thanks for your response. What is the scope of poller config through GUI then?
mmccaugh
Cacti User
Posts: 100
Joined: Mon Apr 09, 2018 1:37 pm

Re: Pupose of Poller Cronjob in Cacti

Post by mmccaugh »

Well apologies as this may not be a perfect explanation.

The cron job is what actually 'does' everything, without it nothing will run or poll.

When the cron job runs I believe it queries MySQL to find out 'what' to do, which is the poller settings as well as hosts to poll etc.. But this is where my understanding gets fuzzy as well.

Specifically around poller intervals, and how to sync the cron job frequency to your collection rates.

Others may have more insight here, but the most important point is if you remove the cron job you are essentially turning Cacti off, the web page will still load but it will stop collecting data and building graphs.
pradeeps
Posts: 36
Joined: Tue Apr 23, 2019 7:56 am

Re: Pupose of Poller Cronjob in Cacti

Post by pradeeps »

Thank you for sharing your now knowledge.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Pupose of Poller Cronjob in Cacti

Post by netniV »

So, it codes like this:

Code: Select all

> Cron starts Poller at cron defined interval (which should be the same as the setting as it's is verified)
  > Poller starts
    > finds the polling interval, checks whether to update MIBs (every four hours)
    > finds the cron interval, and assumes that the interval is either 60 seconds (1 minute) or 300 seconds (5 minutes)
    > finds the number of subprocesses for the current poller, or uses the system default
    > finds how many times a poller should run within a cron period
    > finds how long the current process should run 
    > finds how many items should be used per subprocess
    > for each run within the cron interval:
      > find the hosts that need to be polled
      > see if there was an existing process and warn if so
      > starts spine or cmd.php with the poller id, first and last host to process (maximum calculated above) [repeated until all hosts are processing]
      > waits until the next poller interval or maximum runtime
That doesn't even go into detail about what CMD.PHP or Spine do for each host :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
pradeeps
Posts: 36
Joined: Tue Apr 23, 2019 7:56 am

Re: Pupose of Poller Cronjob in Cacti

Post by pradeeps »

Wow! didnt expect lot happens from the poller job. Thanks for letting me know. I have one more question, since I have around 7.5k hosts (~5 graphs each) configured, does it optimize the performance if I increase the cronjob from every 5 minutes to 10 or even higher?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Pupose of Poller Cronjob in Cacti

Post by netniV »

Not particularly from what I can think of. As described about, the cron interval is assumed to be either 1 minute or 5 minutes (not sure why that seems pretty limited to me). It may be to ensure a refresh of memory usage to prevent memory leaks crippling a system.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
pradeeps
Posts: 36
Joined: Tue Apr 23, 2019 7:56 am

Re: Pupose of Poller Cronjob in Cacti

Post by pradeeps »

Great. Thanks for your information. It is much helpful!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests