Poller out of sync 2 times per day random

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

Moderators: Moderators, Developers

Post Reply
Author
Message
mrnick99
Posts: 4
Joined: Fri Mar 22, 2019 3:22 am

Poller out of sync 2 times per day random

#1 Post by mrnick99 » Wed Apr 24, 2019 2:23 am

My cacti is running great at the moment, only for one thing. The poller gets out of sync 2 times per day at random.
I can't figure out what's wrong with it, and why it is only failing 2 times per day.

This is the error message I get: WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '30' seconds, with a maximum of a '60' seconds, but 305 seconds have passed since the last poll!

I am using /etc/cron.d/cacti with the following config: */5 * * * * root /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Thank you in advance :)

netniV
Cacti Guru User
Posts: 3130
Joined: Sun Aug 27, 2017 12:05 am

Re: Poller out of sync 2 times per day random

#2 Post by netniV » Wed Apr 24, 2019 6:00 am

That usually occurs if one process is overrunning before the next one kicks in. that would suggest either a bad device, bad set of devices or connectivity issue that slows down your polling times.

xdracco
Posts: 42
Joined: Fri Aug 17, 2012 10:19 am
Location: Long Beach, CA

Re: Poller out of sync 2 times per day random

#3 Post by xdracco » Fri Jan 03, 2020 4:06 pm

I had the same issue as the OP and it turned out it was a trickle down effect starting with crontab on the system. My solution may or may not help others but here it is anyways.

Typical crontabs execute cron.hourly, cron.daily, cron.weekly, cron.monthly. What I opted for was create to another "cron.daily" in crontab and split up the number of scripts being executed daily at 3am, daily. This coincided with the email cacti would send me complaining about poller being out of sync.... at precisely 3:05am.

Prior to my change, crontab would execute 15 scripts at 3am. 4 of the scripts backup the server and would push the process over 5 minutes (on most mornings). My guess is the executable that runs all the scripts, `run-parts` was taking too long to complete. To my knowledge, the total number of seconds have passed since the last poll has never exceeded 306 seconds.

So, i created /etc/cron.daily-rdiff and placed my rdiff backup scripts there, to be executed at 3:01am daily. The remaining scripts in /etc/cron.daily are simple scripts, most taking less than 10 seconds to complete. I also changed the crontab execution time to 3:31am daily. As you can see, both cron tasks now execute one minute after cacti poller (when set at 5 min intervals).

Here's my crontab:

Code: Select all

# ------{ custom cron tasks }---------- #
         1     *     *     *     *      root cd /tmp && (nice -n 10 run-parts /usr/local/etc/cron.hourly >/dev/null 2>&1)
         31    3     *     *     *      root cd /tmp && (nice -n -10 run-parts /usr/local/etc/cron.daily >/dev/null 2>&1)
         1     3     *     *     *      root cd /tmp && (nice -n -10 run-parts /usr/local/etc/cron.daily-rdiff >/dev/null 2>&1)
         1     2     *     *     0      root cd /tmp && (nice -n -10 run-parts /usr/local/etc/cron.weekly >/dev/null 2>&1)
         1     1     5     *     *      root cd /tmp && (nice -n 10 run-parts /usr/local/etc/cron.monthly >/dev/null 2>&1)
Hope this helps someone.
The answer to life, the universe and everything is int main() { return 42; }

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

Re: Poller out of sync 2 times per day random

#4 Post by TheWitness » Sun Jan 05, 2020 12:22 pm

Agreeing with @netniV. It would be better, or less impactful if you set the cron interval to 1 minute, and kept the poller interval at 30 seconds. Then, the most you will miss out on will be 30 seconds or so. Ensure that your heartbeat is large enough so that graphs don't gap.
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.

Post Reply