[SOLVED] Cron out of sync with Poller Interval cacti 0.8.7a
Moderators: Developers, Moderators
[SOLVED] Cron out of sync with Poller Interval cacti 0.8.7a
Hi I am new to cacti and I just installed version 0.8.7a last week. I'm having problems with my poller running. When I run it manually as the cacti user I get the following.
--begin cut
#php /var/www/html/cacti/poller.php
12/03/2007 01:23:26 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 489 seconds have passed since the last poll!
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
12/03/2007 01:23:27 PM - SYSTEM STATS: Time:1.1161 Method:cmd.php Processes:1 Threads:N/A Hosts:41 HostsPerProcess:41 DataSources:15 RRDsProcessed:13
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
--end cut
I've read all the posts in regards to this and here are my notes.
- The poller interval and cron interval are both set to 5 minutes
- This was compiled and not installed from a package and only one instance of the cron is running at a time
- made sure poller.php variable $cron_interval is set to 300
- rrd files time stamps are NOT getting updated
- there was a suggest to install a new <functions.php>. This was done
- I get the following from mysql
- select count(*) from poller_output;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
- also did this in mysql
truncate poller_output;
- memory settings in my php.ini is set to 128M
Please help
--begin cut
#php /var/www/html/cacti/poller.php
12/03/2007 01:23:26 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 489 seconds have passed since the last poll!
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
12/03/2007 01:23:27 PM - SYSTEM STATS: Time:1.1161 Method:cmd.php Processes:1 Threads:N/A Hosts:41 HostsPerProcess:41 DataSources:15 RRDsProcessed:13
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
--end cut
I've read all the posts in regards to this and here are my notes.
- The poller interval and cron interval are both set to 5 minutes
- This was compiled and not installed from a package and only one instance of the cron is running at a time
- made sure poller.php variable $cron_interval is set to 300
- rrd files time stamps are NOT getting updated
- there was a suggest to install a new <functions.php>. This was done
- I get the following from mysql
- select count(*) from poller_output;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
- also did this in mysql
truncate poller_output;
- memory settings in my php.ini is set to 128M
Please help
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi
did you add a cron job to run the poller every 5 minutes ?
did you add a cron job to run the poller every 5 minutes ?
Code: Select all
*/5 * * * * /bin/php /path/to/cactipoller.php
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Yeah I actually got this fixed last night. The problem was actually with my crontab. For whatever reason when I set this up to run as cacti in roots crontab the poller did not work
*/5 * * * * cacti php /var/www/html/cacti/poller.php > /dev/null 2>&1
The following below worked when I ran it directly from the cacti user's crontab.
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
The is on Fedora 7
*/5 * * * * cacti php /var/www/html/cacti/poller.php > /dev/null 2>&1
The following below worked when I ran it directly from the cacti user's crontab.
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
The is on Fedora 7
-
- Posts: 36
- Joined: Tue Jun 06, 2006 10:53 am
-
- Posts: 5
- Joined: Sat Jan 26, 2008 5:14 pm
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
The poller is named poller.php. You should not rename it.brokentongue wrote:I can't get a cron job to run. When I run it in Webmin no errors are outputted.
*/5 * * * * root /usr/bin/php /usr/share/cacti/cactipoller.php >/dev/null 2>&1
I'm really stuck. I've also tried everything in this thread.
Reinhard
-
- Posts: 5
- Joined: Sat Jan 26, 2008 5:14 pm
That was a mistake, sorry. This is what it's suppose to be but it's not working.
When I run
I get
PS
I used yum to install cacti and it generated a file with the cron job in cron.d . That wasn't working so I deleted the file and added the cron job to crontab. It still isn't working though.
I'm not sure what else to try. Thanks
Code: Select all
*/5 * * * * root /usr/bin/php /usr/share/cacti/poller.php >/dev/null 2>&1
Code: Select all
php -q /usr/share/cacti/poller.php --force --debug
I'm not sure how to change the cron job to get it to work.02/01/2008 11:24:08 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 76726 seconds have passed since the last poll!
02/01/2008 11:24:09 PM - SYSTEM STATS: Time:1.1448 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:5
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.02
OK u:0.00 s:0.00 r:1.03
OK u:0.00 s:0.00 r:1.03
OK u:0.00 s:0.00 r:1.03
PS
I used yum to install cacti and it generated a file with the cron job in cron.d . That wasn't working so I deleted the file and added the cron job to crontab. It still isn't working though.
I'm not sure what else to try. Thanks
-
- Posts: 5
- Joined: Sat Jan 26, 2008 5:14 pm
Thanks
I checked your link and added a new crontab entry
When I ran it the log said that it didn't exist so I created a link
Then I ran it again and got
I found this guide about cron.
http://www.linuxhelp.net/guides/cron/
I ran the command "crontab -e" and the poller wasn't there so I added it. That still didn't do the trick.[/code]
I checked your link and added a new crontab entry
Code: Select all
prompt> vi /etc/cron.d/cacti
*/5 * * * * cactiuser /usr/bin/php -q /var/www/html/cacti/poller.php > /var/local/log/poller.log 2>&1
Code: Select all
ln -s /usr/share/cacti /var/www/html/cacti
I changed the crontab entry to<br><strong>This script is only meant to run at the command line.</strong>
but I'm still gettingprompt> vi /etc/cron.d/cacti
*/5 * * * * cactiuser /usr/bin/php -q /usr/share/cacti/poller.php > /var/local/log/poller.log 2>&1
So what I figured out is that my personal IP is reported ($_SERVER['REMOTE_ADDR']) when running the cron job in Webmin and I'm not sure why.<br><strong>This script is only meant to run at the command line.</strong>
I found this guide about cron.
http://www.linuxhelp.net/guides/cron/
I ran the command "crontab -e" and the poller wasn't there so I added it. That still didn't do the trick.[/code]
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Sorry if this was misleading. It was not meant to add another crontab but to warn users to use only one. RPM installations often bring /etc/cron.d/cacti. If you then add cacti /etc/crontab, that will fail.brokentongue wrote:Thanks
I checked your link and added a new crontab entryCode: Select all
prompt> vi /etc/cron.d/cacti */5 * * * * cactiuser /usr/bin/php -q /var/www/html/cacti/poller.php > /var/local/log/poller.log 2>&1
To sum up, make sure to only use one crontab. It doesn't matter which one, as long as your syntax is correct (crontab of user "cactiuser" does not require the userid to be added to the command!).
Please tell us, which crontab you use and which line you added for cacti.
Then tell us, if cron is run succesfully (e.g. see /var/log/crontab or the like).
Last, verify that ./log/cacti.log shows some data.
Reinhard
-
- Posts: 5
- Joined: Sat Jan 26, 2008 5:14 pm
Thank you. It's working now.
Maybe this will help someone.
I didn't have cron running. To check to see if cron is running enter the command
You should get 2 lines
Maybe this will help someone.
I didn't have cron running. To check to see if cron is running enter the command
Code: Select all
ps aux | grep crond
If you only have grep then cron isn't running. Then start it using the commandroot 14833 0.0 0.1 5240 1108 ? Ss 21:59 0:00 crond
root 14856 0.0 0.0 3900 664 pts/0 S+ 21:59 0:00 grep crond
Code: Select all
/etc/rc.d/init.d/crond start
Last edited by brokentongue on Sat Feb 02, 2008 6:13 pm, edited 1 time in total.
it's nt solved for all....
I use RH5.2 and your way of configurating cron was not working for me.
Here's whet I did though:
- I logged to root (I'm running this cron job form root account)
- run crontab -e
- add (you migh want to update the paths with yours)
Save it and enjoy.
You job will be save under /var/spool/cron/root
EnjoY!
More info http://www.linuxhelp.net/guides/cron/
Later on....
OK It's still not working like it should be!
Any ideas anyone??
I use RH5.2 and your way of configurating cron was not working for me.
Here's whet I did though:
- I logged to root (I'm running this cron job form root account)
- run crontab -e
- add (you migh want to update the paths with yours)
Code: Select all
*/5 * * * * root php /var/www/html/cacti/poller.php > /dev/null 2>&1
You job will be save under /var/spool/cron/root
EnjoY!
More info http://www.linuxhelp.net/guides/cron/
Later on....
OK It's still not working like it should be!
Any ideas anyone??
OK!
It's working for me now.. Overall here's my configuration
crontab -e
and put
Code:
*/5 * * * * php -q /var/www/html/cacti/poller.php --force --debug >> /var/local/log/poller.log 2>&1
Check the cron command that I gave you above. It's should show some more logs that your command does. Let me know.
My problem was cause by cron command. I added root before php -q.
I didn't get any logs before I pointed it to a file ..soooo check it!
Cheers...
It's working for me now.. Overall here's my configuration
crontab -e
and put
Code:
*/5 * * * * php -q /var/www/html/cacti/poller.php --force --debug >> /var/local/log/poller.log 2>&1
Check the cron command that I gave you above. It's should show some more logs that your command does. Let me know.
My problem was cause by cron command. I added root before php -q.
I didn't get any logs before I pointed it to a file ..soooo check it!
Cheers...
Who is online
Users browsing this forum: No registered users and 1 guest