Why poller.php don't run !

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

Moderators: Developers, Moderators

Post Reply
vpnnav
Posts: 16
Joined: Thu May 15, 2008 6:23 pm

Why poller.php don't run !

Post by vpnnav »

Hi !
I have a problem with crontab
after i add :
*/2 * * * * cactiuser php /var/www/html/cacti/poller.php /dev/null 2>&1
No polling is excuted :(
However if I take from CLI such as :
[root@anh cacti]# php poller.php
05/19/2008 05:42:36 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '60' seconds, with a maximum of a '300' second Cron, but 603 seconds have passed since the last poll!
OK u:0.00 s:0.03 r:3.10
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.04 r:3.11
OK u:0.00 s:0.04 r:3.11
OK u:0.00 s:0.04 r:3.11
05/19/2008 05:42:41 PM - SYSTEM STATS: Time:4.9390 Method:cmd.php Processes:10 Threads:N/A Hosts:3 HostsPerProcess:1 DataSources:11 RRDsProcessed:8
OK u:0.00 s:0.04 r:4.13
-> Nothing is seemed to wrong with php or poller.php .
I don't understand what happend to Crontabs ?and result of that my cacti log is only line : 05/19/2008 05:34:21 PM - WEBUI: Cacti Log Cleared from Web Management Interface
Have any ideas help me ?
thanks alot
kanada
Cacti User
Posts: 137
Joined: Sun Aug 28, 2005 12:51 pm

Re: Why poller.php don't run !

Post by kanada »

vpnnav wrote:Hi !
I have a problem with crontab
after i add :
*/2 * * * * cactiuser php /var/www/html/cacti/poller.php /dev/null 2>&1
No polling is excuted :(
However if I take from CLI such as :
[root@anh cacti]# php poller.php
05/19/2008 05:42:36 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the Poller Interval! The Poller Interval is '60' seconds, with a maximum of a '300' second Cron, but 603 seconds have passed since the last poll!
OK u:0.00 s:0.03 r:3.10
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.03 r:3.11
OK u:0.00 s:0.04 r:3.11
OK u:0.00 s:0.04 r:3.11
OK u:0.00 s:0.04 r:3.11
05/19/2008 05:42:41 PM - SYSTEM STATS: Time:4.9390 Method:cmd.php Processes:10 Threads:N/A Hosts:3 HostsPerProcess:1 DataSources:11 RRDsProcessed:8
OK u:0.00 s:0.04 r:4.13
-> Nothing is seemed to wrong with php or poller.php .
I don't understand what happend to Crontabs ?and result of that my cacti log is only line : 05/19/2008 05:34:21 PM - WEBUI: Cacti Log Cleared from Web Management Interface
Have any ideas help me ?
thanks alot
Correct crontab entry must be a

Code: Select all

*/2 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Regards,
Alex.
neel
Posts: 3
Joined: Wed May 21, 2008 2:23 pm

Post by neel »

Hello All,

I got the same exact problem... poller.php is not populating the data. If I run "php -f poller.php" from the CLI it runs fine but it looks like it doesn't run from the cronjob while syslog logs that cronjob was executed but no graph is populated with data.

Code: Select all

May 21 15:32:01 spike /USR/SBIN/CRON[15859]: (root) CMD (cactiuser php /var/www/cacti/poller.php > /dev/null 2>&1)

I am running Ubuntu 8.04 LTS, apache2, php5, mysql5, cacti-spine-0.8.7a, cacti-0.8.7b, rrdtool-1.2.27 and its a fresh installation.

Any idea?

Cheers,
Neel
neel
Posts: 3
Joined: Wed May 21, 2008 2:23 pm

Post by neel »

Attached is the DEBUG log while running poller.php from the CLI. Hope if someone can figure out this problem...

Cheers,
Neel
Attachments
poller_debug_log.txt
poller.php debug log while ran from CLI
(11.12 KiB) Downloaded 249 times
buck
Posts: 17
Joined: Tue Sep 04, 2007 10:09 am

Post by buck »

Try putting the command under the crontab for cactiuser instead of root.
neel
Posts: 3
Joined: Wed May 21, 2008 2:23 pm

Post by neel »

Thanks for your reply...

But this is where I got confused... The installation guide said to run the cronjob as user "cactiuser" but it does not say anywhere if we have to create a local system user as "cactiuser". We did create one user but thats for MySQL DB...

So the question is do we have to create a local system user as "cactiuser" and run the cronjob as "cactiuser" and not as "root"? If so, do we have to change the permission also on "poller.php" to "cactiuser"?

Cheers,
Neel
buck
Posts: 17
Joined: Tue Sep 04, 2007 10:09 am

Post by buck »

You do have to create or use a valid user name. The instructions don't go though the step of creating an account, but do specify to use a valid one.

Code: Select all

Set the appropriate permissions on cacti's directories for graph/log generation. You should execute these commands from inside cacti's directory to change the permissions.

shell> chown -R cactiuser rra/ log/

(Enter a valid username for cactiuser, this user will also be used in the next step for data gathering.)
SoftDux
Posts: 39
Joined: Thu Jun 19, 2008 9:24 am
Location: Johannesburg, South Africa
Contact:

Post by SoftDux »

I found that it also works if you add it to root's crontab, without specifying a user:

*/5 * * * * /usr/bin/php /var/www/html/graphs/poller.php
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests