Strange behaviour

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

Moderators: Developers, Moderators

Post Reply
byteZero
Posts: 2
Joined: Wed Aug 31, 2005 4:29 am

Strange behaviour

Post by byteZero »

-------------------------------------------------------
OS: Debian Linux Sarge (3.1r0)
Apache 2
Php4
cacti-0.8.6f.tar.gz
-------------------------------------------------------

Hi,
i setup /etc/crontab like this:

Code: Select all

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6    * * 7   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6    1 * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly

# Cacti
*/5 * * * * servicos php4 /home/servicos/public_html/apps/cacti/poller.php > /dev/null 2>&1
and i get every time the following in /var/log/cacti/cacti.log:

Code: Select all

08/31/2005 11:45:03 AM - CMDPHP: Poller[0] ERROR: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL   database name in 'include/config.php'
my include/config.php relevant part is as follow:

Code: Select all

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "servicos";
$database_password = "password";
What i can't understand is why running the command:

Code: Select all

php4 /home/servicos/public_html/apps/cacti/poller.php 
manually in the bash works, and with crontab i get the that message i posted above in every polling cycle.

The most curious part is that i removed the crontab entry from /etc/crontab and added the same entry to servico's crontab and i still got the same error message in the log.


Any help is most welcome,

Thank you.
rkramer
Cacti User
Posts: 54
Joined: Fri Jun 03, 2005 12:25 pm

Post by rkramer »

my bet is the servicos account doesn't have permission to the include file...
byteZero
Posts: 2
Joined: Wed Aug 31, 2005 4:29 am

Post by byteZero »

rkramer wrote:my bet is the servicos account doesn't have permission to the include file...
Thank you for your reply, but i don't think thats the problem because all files in cacti directory where created by servicos and have read permissions (i think it suffice for php including?) has you can see:

Code: Select all

-rw-r--r--  1 servicos servicos  4204 2005-07-01 04:45 auth.php
-rw-r--r--  1 servicos servicos  2077 2005-07-01 04:45 bottom_footer.php
-rw-r--r--  1 servicos servicos 11641 2005-07-01 04:45 config_arrays.php
-rw-r--r--  1 servicos servicos  4201 2005-07-01 04:45 config_constants.php
-rw-r--r--  1 servicos servicos 31131 2005-07-01 04:45 config_form.php
-rw-r--r--  1 servicos servicos  6332 2005-08-31 14:35 config.php
-rw-r--r--  1 servicos servicos  6338 2005-08-31 14:17 config.php~
-rw-r--r--  1 servicos servicos 28079 2005-07-01 04:45 config_settings.php
drwxr-xr-x  2 servicos servicos  4096 2005-07-01 04:45 gettext
drwxr-xr-x  2 servicos servicos  4096 2005-07-01 04:45 html
drwxr-xr-x  3 servicos servicos  4096 2005-07-01 04:45 jscalendar
-rw-r--r--  1 servicos servicos  7109 2005-07-01 04:45 layout.js
-rw-r--r--  1 servicos servicos  6848 2005-07-01 04:45 main.css
-rw-r--r--  1 servicos servicos  9261 2005-07-01 04:45 top_graph_header.php
-rw-r--r--  1 servicos servicos  4203 2005-07-01 04:45 top_header.php
drwxr-xr-x  2 servicos servicos  4096 2005-07-01 04:45 treeview
-rw-r--r--  1 servicos servicos 22144 2005-07-01 04:45 zoom.js
I got it working just a few seconds ago, but the problem is that i don't know how da hell i did it (if i really did something!).
But the comic part is that now i get the following in the /var/log/cacti/cacti.log:

Code: Select all

08/31/2005 03:05:04 PM - CMDPHP: Poller[0] ERROR: Cannot connect to MySQL server on ''. Please make sure you have specified a valid MySQL   database name in 'include/config.php'
ok has you guys may have noticed, the only thing that changed was the host, now it's empty!

If someone can clear me up on this one, please do, i don't really like misterious stuff happening on my server :(
Even because it might be some kind of exploit/bug, or just some plain stupid thing i did :roll:

Thanks and keep up the excelent work with cacti!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests