PDA

View Full Version : Trouble with Zabbix web-gui


Bin
10-11-2005, 11:36
Hi there!

I configured and compile Zabbix-1.1beta2 (on OpenBSD 3.7) for work with MySQL.
Started OK (in zabbix_server.log has no errors or warnings).
When i try to open http://localhost/zabbix/, i have errors in httpd error file:
"[error] PHP Warning: mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /zabbix/include/db.inc.php on line 37
[error] PHP Warning: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /zabbix/include/db.inc.php on line 38
[error] PHP Warning: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: A link to the server could not be established in /zabbix/include/db.inc.php on line 38"

/var/run/mysql/mysql.sock exist.

Whats wrong? Any clues?
Thanks!

elkor
10-11-2005, 13:47
you need to edit the zabbixfrontendroot/include/db.inc.php file to specify your database type and authentication credentials.

Bin
10-11-2005, 14:34
It's already done:
// DATABASE CONFIGURATION
// $DB_TYPE ="POSTGRESQL";
$DB_TYPE ="MYSQL";
$DB_SERVER ="localhost";
$DB_DATABASE ="zabbix";
$DB_USER ="zabbix";
$DB_PASSWORD ="real_pasasword";
// END OF DATABASE CONFIGURATION

And user "zabbix" have appropriate permissions for "zabbix" database.

James Wells
10-11-2005, 16:40
Greetings,

Right off the bat, it looks like your Zabbix user may have remote privs, but not local privs. Another thing to check is if your socket is configured correctly. For example, some distro's create the MySQL socket in /tmp and then soft link to it from /var/lib/mysql, others create it in /var/tmp/ and soft link to it from /lib/MySQL.

elkor
10-11-2005, 17:57
also: if you are running in selinux mode and have moved the database files (say to a larger partition) without updating the acls you might get this error as the apache user might not be able to access the database.

Bin
11-11-2005, 11:35
As usual, everything was simple:
OpenBSD has chrooted apache.

#mkdir /var/www/var/run/mysql
#ln /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock
solve this problem