Ad Widget

Collapse

Problem With Initial Setup Zabbix 6.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahv800
    Junior Member
    • Jan 2024
    • 2

    #1

    Problem With Initial Setup Zabbix 6.4

    ​Hi everyone

    I have a problem with initial configuration of Zabbix 6.4.
    i follow the procedure of installation of Zabbix
    https://www.zabbix.com/la/download?zabbix=6.4&os_distribution=alma_linux&os_ version=8&components=server_frontend_agent&db=mysq l&ws=nginx

    This es my Distro
    cat /etc/almalinux-release
    AlmaLinux release 8.9 (Midnight Oncilla)

    This is the version that i been install:
    Zabbix Package
    ZABBIX VERSION: 6.4
    OS DISTRIBUTION: Alma Linux
    OS VERSION: 8
    ZABBIX COMPONENT: Server, Frontend, Agent
    DATABASE: MySQL
    WEB SERVER: NGIX


    Everything its´ok here.

    This is the Error: "Unable to select configuration."

    cat /var/log/zabbix/zabbix_server.log

    1665:20240111:192223.281 Starting Zabbix Server. Zabbix 6.4.10 (revision 4da16fb82f5).
    1665:20240111:192223.281 ****** Enabled features ******
    1665:20240111:192223.281 SNMP monitoring: YES
    1665:20240111:192223.281 IPMI monitoring: YES
    1665:20240111:192223.281 Web monitoring: YES
    1665:20240111:192223.281 VMware monitoring: YES
    1665:20240111:192223.281 SMTP authentication: YES
    1665:20240111:192223.281 ODBC: YES
    1665:20240111:192223.281 SSH support: YES
    1665:20240111:192223.281 IPv6 support: YES
    1665:20240111:192223.281 TLS support: YES
    1665:20240111:192223.281 ******************************
    1665:20240111:192223.281 using configuration file: /etc/zabbix/zabbix_server.conf
    1665:20240111:192223.286 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)


    ​mysql> \s
    --------------
    mysql Ver 8.0.32 for Linux on x86_64 (Source distribution)

    Connection id: 104
    Current database: zabbix
    Current user: root@localhost
    SSL: Not in use
    Current pager: stdout
    Using outfile: ''
    Using delimiter: ;
    Server version: 8.0.32 Source distribution
    Protocol version: 10
    Connection: Localhost via UNIX socket
    Server characterset: utf8mb4
    Db characterset: utf8mb4
    Client characterset: utf8mb4
    Conn. characterset: utf8mb4
    UNIX socket: /var/lib/mysql/mysql.sock
    Binary data as: Hexadecimal

    mysql> SELECT User,Host FROM mysql.user;
    +------------------+-----------+
    | User | Host |
    +------------------+-----------+
    | mysql.infoschema | localhost |
    | mysql.session | localhost |
    | mysql.sys | localhost |
    | root | localhost |
    | zabbix | localhost |
    +------------------+-----------+


    ​​Please, Help me with this.​

  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    When you're setting up a new Zabbix install, after you've created the empty database, you need to import an SQL file to create all the database structure (tables, etc.).

    It's in step "d" of the download instructions on the page you listed:

    Code:
    # zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix  ​
    The error message you're getting isn't about the mysql.users table, which is for any database user, it's for the zabbix.users table, which defines the Zabbix users that have access to the web-interface.

    Comment


    • ahv800
      ahv800 commented
      Editing a comment
      Hi tim.mooney

      Yes, the importe SQL File wan done before.
      This is the probe..

      [root@localhost usr_vps1]# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
      Enter password:
      ERROR 1050 (42S01) at line 1: Table 'role' already exists.

      How i can verify zabbix user has access to the web-interface?
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #3
    Originally posted by ahv800
    1665:20240111:192223.286 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)
    That error says that the zabbix_server process is connecting to the 'zabbix' database but the zabbix.users table is not populated with the expected entries. That implies that the database was not correctly populated with initial data.

    Since this is a new install, you could try stop the zabbix_server process, delete the database and the 'zabbix@localhost' MySQL user and then repeat steps 2d from the instructions.

    As far as the web interface, once you have the (separate) zabbix_server working and connecting to the database, then steps 2f through 2h cover the web interface.

    Comment

    • ahv800
      Junior Member
      • Jan 2024
      • 2

      #4
      1. Stop Zabbix Service
      systemctl stop zabbix-server

      2. Delete User and Database
      mysql -u root -p -h localhost -e "drop database zabbix;"
      mysql -u root -h localhost -e "drop user 'zabbix'@'localhost';"



      3.
      ​Install and configure Zabbix for your platform
      # rpm -Uvh https://repo.zabbix.com/zabbix/6.4/r...el8.noarch.rpm
      # dnf clean all
      # dnf module switch-to php:7.4
      # dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
      # mysql -uroot -p
      password
      mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
      mysql> create user zabbix@localhost identified by 'password';
      mysql> grant all privileges on zabbix.* to zabbix@localhost;
      mysql> set global log_bin_trust_function_creators = 1;
      mysql> quit;

      Import Schema
      # zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

      Disable log_bin_trust_function_creators option
      # mysql -uroot -p
      password
      mysql> set global log_bin_trust_function_creators = 0;
      mysql> quit;

      Edit file /etc/zabbix/zabbix_server.conf
      DBPassword=password

      Edit file /etc/nginx/conf.d/zabbix.conf uncomment and set 'listen' and 'server_name' directives.
      # listen 8080;
      # server_name example.com;


      The proccess was Susseccfully!!!
      Thnks for your Help.​

      Comment

      • francha07
        Junior Member
        • May 2024
        • 1

        #5
        I had the same problem working with an Ubuntu server and Zabbix 6.4. I took me a while to figure it out but thanks to your answer I was able to do it @ahv800 . I'm leaving what I did in case someone might find it helpful in the future.

        I was following the steps show in the Download and install Zabbix 6.4 for Ubuntu 24.04 (Noble) Server, Frontend, Agent, MySQL, Apache. The first problem I had was that I was getting this error: ERROR 1050 (42S01) at line 1: Table 'role' already exists when I tried to run this line: create user zabbix@localhost identified by 'password';.

        I tried to solve that problem and I ended up generating more problems in my installation like: ERROR 1396 (HY000): Operation CREATE USER failed for 'zabbix'@'localhost', Job for zabbix-server.service failed because the service did not take the steps required by its unit configuration.
        See "systemctl status zabbix-server.service" and "journalctl -xeu zabbix-server.service" for details, and so on.

        Solution:
        1. mysql -u root -p. type password.
        2. mysql> drop database zabbix;
        3. mysql> select * from users; It should show you a zabbix user in here.
        +-----------+------------------+------------+
        | Host | User | Super_priv |
        +-----------+------------------+------------+
        | localhost | debian-sys-maint | Y |
        | localhost | mysql.infoschema | N |
        | localhost | mysql.session | Y |
        | localhost | mysql.sys | N |
        | localhost | root | Y |
        | localhost | zabbix | Y |
        +-----------+------------------+------------+​
        4. mysql> drop user 'zabbix'@'localhost'; It should get rid of zabbix user.
        5. mysql> quit;
        6. Check you have all the packages installed. apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
        7. # mysql -uroot -p
        password
        mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
        mysql> create user zabbix@localhost identified by 'password';
        mysql> grant all privileges on zabbix.* to zabbix@localhost;
        mysql> set global log_bin_trust_function_creators = 1;
        mysql> quit;​
        8. zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
        9. mysql -uroot -p
        password
        mysql> set global log_bin_trust_function_creators = 0;
        mysql> quit;​
        10. Edit file /etc/zabbix/zabbix_server.conf with your password
        11. systemctl restart zabbix-server zabbix-agent apache2
        # systemctl enable zabbix-server zabbix-agent apache2​
        12. Configure your frontend and search for your server with your ip.



        Comment

        Working...