Ad Widget

Collapse

Trouble with Zabbix web-gui

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bin
    Junior Member
    • Nov 2005
    • 3

    #1

    Trouble with Zabbix web-gui

    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
    Senior Member
    • Jul 2005
    • 299

    #2
    you need to edit the zabbixfrontendroot/include/db.inc.php file to specify your database type and authentication credentials.

    Comment

    • Bin
      Junior Member
      • Nov 2005
      • 3

      #3
      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.

      Comment

      • James Wells
        Senior Member
        • Jun 2005
        • 664

        #4
        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.
        Unofficial Zabbix Developer

        Comment

        • elkor
          Senior Member
          • Jul 2005
          • 299

          #5
          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.

          Comment

          • Bin
            Junior Member
            • Nov 2005
            • 3

            #6
            resolved

            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

            Comment

            Working...