Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Why poller.php don't run !

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific
Author Message
vpnnav



Joined: 15 May 2008
Posts: 16

PostPosted: Sun May 18, 2008 8:44 pm    Post subject: Why poller.php don't run ! Reply with quote

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
Back to top
kanada
Cacti User


Joined: 28 Aug 2005
Posts: 125

PostPosted: Mon May 19, 2008 5:12 am    Post subject: Re: Why poller.php don't run ! Reply with quote

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:

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


Regards,
Alex.
Back to top
neel



Joined: 21 May 2008
Posts: 3

PostPosted: Wed May 21, 2008 2:44 pm    Post subject: Reply with quote

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:

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
Back to top
neel



Joined: 21 May 2008
Posts: 3

PostPosted: Wed May 21, 2008 2:55 pm    Post subject: Reply with quote

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

Cheers,
Neel



poller_debug_log.txt
 Description:
poller.php debug log while ran from CLI

Download
 Filename:  poller_debug_log.txt
 Filesize:  11.12 KB
 Downloaded:  58 Time(s)

Back to top
buck



Joined: 04 Sep 2007
Posts: 17

PostPosted: Thu May 22, 2008 11:44 am    Post subject: Reply with quote

Try putting the command under the crontab for cactiuser instead of root.
Back to top
neel



Joined: 21 May 2008
Posts: 3

PostPosted: Thu May 22, 2008 12:09 pm    Post subject: Reply with quote

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
Back to top
buck



Joined: 04 Sep 2007
Posts: 17

PostPosted: Thu May 22, 2008 1:36 pm    Post subject: Reply with quote

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:

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.)
Back to top
SoftDux



Joined: 19 Jun 2008
Posts: 37
Location: Johannesburg, South Africa

PostPosted: Thu Aug 07, 2008 9:24 am    Post subject: Reply with quote

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


Quote:
*/5 * * * * /usr/bin/php /var/www/html/graphs/poller.php
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group