Ad Widget

Collapse

Zabbix Server can't connet to remote Zabbix Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hernan
    Member
    • Sep 2016
    • 67

    #1

    Zabbix Server can't connet to remote Zabbix Database

    Hello Guys,

    I have the following problem:

    I have a Zabbix Server and Zabbix Database on differents servers:

    Zabbix-Server: 192.168.1.10 (Debian)

    Zabbix-Server: 192.168.1.11 (Debian)

    the zabbix_server.conf:
    *********************************
    ### Option: DBHost

    DBHost=192.168.10.11

    ### Option: DBName

    DBName=zabbix


    ### Option: DBUser

    DBUser=zabbix

    ### Option: DBPassword

    DBPassword=xxxxxxxxxxx
    ******************************

    The remote connection with the user zabbix is workink perfect:
    ************
    root@debian:/etc/zabbix# mysql -h 192.168.1.11 -uzabbix -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 122
    Server version: 5.5.55-0+deb8u1 (Debian)

    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql>
    *********************

    The problem appears when I tryied to connect via the Web Console. I received the following error message:
    ******
    Database error

    Error connecting to database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    ******

    Can you help me with this issue?

    Thanks in advance.
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    Your "Web Console" != "Zabbix server". It's a Zabbix frontend and you have to configure it as well: https://www.zabbix.com/documentation...lling_frontend
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • hernan
      Member
      • Sep 2016
      • 67

      #3
      Originally posted by jan.garaj
      Your "Web Console" != "Zabbix server". It's a Zabbix frontend and you have to configure it as well: https://www.zabbix.com/documentation...lling_frontend
      Thanks for your help !!!!

      I edited the file /etc/zabbix/web/zabbix.conf.php :

      *************************************************
      <?php
      // Zabbix GUI configuration file.
      global $DB;

      $DB['TYPE'] = 'MYSQL';
      $DB['SERVER'] = '192.168.1.11'; <-------- I added the Zabbix Database IP Address
      $DB['PORT'] = '0';
      $DB['DATABASE'] = 'zabbix';
      $DB['USER'] = 'zabbix';
      $DB['PASSWORD'] = 'xxxxxxxxxxx';

      // Schema name. Used for IBM DB2 and PostgreSQL.
      $DB['SCHEMA'] = '';

      $ZBX_SERVER = 'localhost';
      $ZBX_SERVER_PORT = '10051';
      $ZBX_SERVER_NAME = 'Itelkom';

      $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

      *********************
      Then I restarted the apache2 services and the problem was solved!!!

      Thanks in advance!!!!

      Comment

      Working...