poller.php doesn't execute cmd.php

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

Moderators: Developers, Moderators

Post Reply
Selene
Posts: 3
Joined: Fri Jun 12, 2009 3:12 pm

poller.php doesn't execute cmd.php

Post by Selene »

Hi everybody:

I have a problem when executing poller.php by crontab, it exceutes each 5 minutes, but no rrd files are created in my rra folder, I had tried everiting in other posts but I can't solve this.

I send the output on poller.php run by crontab to a log file and I see this:

Code: Select all

03/12/2010 10:25:01 AM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '301', Max Runtime '298', Poller Runs: '1'
03/12/2010 10:25:01 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/bin/php, ARGS: -q "/usr/local/cacti-0.8.7e/cmd.php" 0 2]
03/12/2010 10:30:00 AM - POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting.
03/12/2010 10:30:00 AM - SYSTEM STATS: Time:298.8975 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:13 RRDsProcessed:0
As you can see everyting is ok just that there is no RRDsProcessed so I send the output of background executing process to see what is was doing ehen executin cmd.php an I found that the ouput of this is just:

Code: Select all

FATAL: Cannot connect to MFATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
I check everything related to the database on global.php and config.php and the result is the same, I had changed the localhost by 127.0.0.1 and there is no result, all the parameters for the database connection are OK so I hope you can help me to solve this.

Technical information:
Cacti version: 0.8.7e
OS: Solaris Sparc 10
PHP: 5.2.13
Apache: 2.2.14
RRDTool: 1.2.19
SNMP: 5.0.9
MySQL: 5.0.67

Thanks in advance.
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

You shouldn't change any values in global.php.

Did you try spine as polling-method? Does this work (needs extra DB-Configuration)

Is the RRDTool version in the Settings Tab on the correct value (1.2)?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

More likely the PHP5 cli configuration does not include the PHP module.

Run:

Code: Select all

php -m
And look for "mysql". Depending on your release, php's configuration will be in /etc/php5/cli/php.ini for the Command Line and /etc/php5/apache/php.ini for the web server.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Selene
Posts: 3
Joined: Fri Jun 12, 2009 3:12 pm

Post by Selene »

TheWitness wrote:More likely the PHP5 cli configuration does not include the PHP module.

Run:

Code: Select all

php -m
And look for "mysql". Depending on your release, php's configuration will be in /etc/php5/cli/php.ini for the Command Line and /etc/php5/apache/php.ini for the web server.

TheWitness
HI!

This is the output:

Code: Select all

root@cacti # /usr/local/php/bin/php -m
[PHP Modules]
ctype
curl
date
dom
exif
filter
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mssql
mysql
mysqli
openssl
pcre
PDO
pdo_sqlite
posix
Reflection
session
SimpleXML
sockets
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

I don´t have php.ini file because I installed pre-compiled packages from sunfreeware. Is necessary this file? I have another cacti server (0-8-6i version) and I installed pre-compiled packages too, and I don´t have any problem with old cacti server.

Another data

My cmd.php file

Code: Select all

-rw-r--r--   1 1000     100        18355 Mar 12 10:37 /usr/local/cacti-0.8.7e/cmd.php
I was testing the output from cmd, I gave execution permissions to this.

If I run cmd.php from command line /usr/local/php/bin/php -q /usr/local/cacti-0.8.7e/cmd.php 2 2, rrd files are created for host id 2 and I see graphs in cacti; but If I run cmd.php giving hots id's range, then nothing happens. (cmd.php 0 3)

By the way, rrdtool it is correct on settings tab.

What do you suggest?

Thanks
[/code]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well first of all, if you run cmd.php, it does not, in fact, create the rrdfiles. It's poller.php. So, this means that for some reason poller.php can not find/launch cmd.php.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests