Prob when i launch http://ip_addr/cacti/ for the first time

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

Moderators: Developers, Moderators

Post Reply
joyeux666
Posts: 20
Joined: Wed Sep 28, 2005 7:15 am
Location: France

Prob when i launch http://ip_addr/cacti/ for the first time

Post by joyeux666 »

Hi,

I'm french and i will test cacti on a server RH enterprise 4.0.

I've installed all necessaries package (php,mysql,php-mysql,net-snmp,rrdtool,...)

When I launch http://ip_addr/cacti/

it return :

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

I verified config.php and i specified all parameters

database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "password";

and with webmin, i've created a databae cacti with user cactiuser

When i open error.log of httpd

I see :

PHP Warning : mysql_connect():access denied for user 'cactiuser'@'localhost' (using password=yes) in /opt/administration/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Have you an idea??

reagrds and sorry for my bad english

David
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Did you follow the instructions in http://www.cacti.net/downloads/docs/htm ... _unix.html to create the cacti database? You may have to change userid/password of that examples to meet your needs.
Reinhard
dameloong
Posts: 5
Joined: Tue Sep 27, 2005 5:33 am

Post by dameloong »

disable SELinux ...
had the same problem with that ...now fixed
joyeux666
Posts: 20
Joined: Wed Sep 28, 2005 7:15 am
Location: France

Post by joyeux666 »

SELinux is a distribution.....??? no

Disable SELinux, I don't understand....

I would like to test by command :

[root@cacti /]#/usr/bin/php /opt/administration/cacti/poller.php

return :

PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/msql.so' - /usr/lib/php4/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/msql.so' - /usr/lib/php4/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
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
Content-type: text/html
X-Powered-By: PHP/4.3.9

09/30/2005 09:37:23 AM - SYSTEM STATS: Time:1.0307 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:5
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/msql.so' - /usr/lib/php4/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[root@cacti /]# PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/msql.so' - /usr/lib/php4/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0


I copy my file /usr/lib/php4/mysql.so to msql.so and i test, return :


[root@cacti /]# /usr/bin/php /opt/administration/cacti/poller.php
PHP Notice: Constant MYSQL_ASSOC already defined in Unknown on line 0
PHP Notice: Constant MYSQL_NUM already defined in Unknown on line 0
PHP Notice: Constant MYSQL_BOTH already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_COMPRESS already defined in Unknown on line 0PHP Notice: Constant MYSQL_CLIENT_SSL already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_INTERACTIVE already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_IGNORE_SPACE already defined in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_connect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_pconnect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_close in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_select_db in Unknown on line 0
...............
PHP Warning: mysql: Unable to register functions, unable to load in Unknown on line 0
PHP Notice: Constant MYSQL_ASSOC already defined in Unknown on line 0
PHP Notice: Constant MYSQL_NUM already defined in Unknown on line 0
.....


In /opt/administration/cacti/log/error.log, I've :

09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[3] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[4] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[5] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[6] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[7] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Time: 0.1070 s, Theads: N/A, Hosts:


What's the problem ??

regards

david
StaWha
Posts: 36
Joined: Tue Jul 26, 2005 11:05 am

Post by StaWha »

I have got the same OS, and on my system i don't try to load
msql.so but mysql.so. It seems that you have a bad php configuration.
In /etc/php.d/ you may try to move your msql.ini and create a mysql.ini
with the content:
extension=mysql.so
joyeux666
Posts: 20
Joined: Wed Sep 28, 2005 7:15 am
Location: France

Post by joyeux666 »

I verify my files and I 've in /etc/php.d/ mysql.ini with the content :

extension=mysql.so

That's normal when i execute
[root@cacti /]#/usr/bin/php /opt/administration/cacti/poller.php

return

PHP Notice: Constant MYSQL_ASSOC already defined in Unknown on line 0
PHP Notice: Constant MYSQL_NUM already defined in Unknown on line 0
PHP Notice: Constant MYSQL_BOTH already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_COMPRESS already defined in Unknown on line 0PHP Notice: Constant MYSQL_CLIENT_SSL already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_INTERACTIVE already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_IGNORE_SPACE already defined in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_connect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_pconnect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_close in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_select_db in Unknown on line 0
...............
PHP Warning: mysql: Unable to register functions, unable to load in Unknown on line 0
PHP Notice: Constant MYSQL_ASSOC already defined in Unknown on line 0
PHP Notice: Constant MYSQL_NUM already defined in Unknown on line 0

And why i've this lines in my file error .log of the directory /cacti/log/

09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[3] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[4] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[5] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[6] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Host[1] DS[7] WARNING: Result from CMD not valid. Partial Result:
09/30/2005 09:40:01 AM - CMDPHP: Poller[0] Time: 0.1070 s, Theads: N/A, Hosts:


regards

David
StaWha
Posts: 36
Joined: Tue Jul 26, 2005 11:05 am

Post by StaWha »

For me (maybe i'm wrong),you try to load two time
mysql extension.
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/msql.so' - /usr/lib/php4/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
This warning meen that you try to load an extension you don't have install,
but msql extension is not required to run cacti.
You have copy /usr/lib/php4/mysql.so to msql.so, so now your system
try to load two time mysql.so whith different name.
Just remove or move your msql.ini from /etc/php.d/
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

joyeux666 wrote:SELinux is a distribution.....??? no

Disable SELinux, I don't understand....
Look at the "SELinux and problems with Cacti..." post in this forum on how to disable it. SELinux is installed on many distributions like Fedora, RedHat, CentOS, SuSe(I think) and some others
joyeux666
Posts: 20
Joined: Wed Sep 28, 2005 7:15 am
Location: France

Post by joyeux666 »

I verify in the folder /etc/selinux/, the file config contains selinux=disabled
So, the problem don't come of selinux.
joyeux666
Posts: 20
Joined: Wed Sep 28, 2005 7:15 am
Location: France

Post by joyeux666 »

I have the graphs in cacti but without data....

In graph debug mod, rrdtool ok....

in crontab, I've

*/5 * * * * cactiuser /usr/bin/php /opt/administration/cacti/cmd.php > /dev/null 2&1

I've modified rights of folder rra and log (cactiuser)

When i execute /usr/bin/php /opt/administration/cacti/cmd.php returns

PHP Notice: Constant MYSQL_ASSOC already defined in Unknown on line 0
PHP Notice: Constant MYSQL_NUM already defined in Unknown on line 0
PHP Notice: Constant MYSQL_BOTH already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_COMPRESS already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_SSL already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_INTERACTIVE already defined in Unknown on line 0
PHP Notice: Constant MYSQL_CLIENT_IGNORE_SPACE already defined in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_connect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_pconnect in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_close in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_select_db in Unknown on line 0
........
........
........
........
PHP Warning: Function registration failed - duplicate name - mysql_numrows in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_listdbs in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_listtables in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_listfields in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_db_name in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_dbname in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_tablename in Unknown on line 0
PHP Warning: Function registration failed - duplicate name - mysql_table_name in Unknown on line 0
PHP Warning: mysql: Unable to register functions, unable to load in Unknown on line 0

I think it's for that i haven't data in my graphs......
Have you an idea??

regards
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests