Skip to content

Proxy Setup

Environment Credentials

  • Database Name: zabbix_proxy
  • Database Username: zabbix
  • Database Password: mu)dyMusic13

Zabbix Proxy Setup

  1. Login as root and ensure system is up to date before starting the setup.
    Bash
    apt update && apt dist-upgrade -y
    
  2. Add Zabbix repository
    Bash
    wget https://repo.zabbix.com/zabbix/7.4/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.4+ubuntu24.04_all.deb -O /tmp/zabbix-repository.deb
    apt install -y /tmp/zabbix-repository.deb && apt update
    
  3. Install Zabbix Proxy and database.
    Bash
    apt install -y zabbix-proxy-mysql zabbix-sql-scripts mysql-server
    
  4. Secure MySQL server deployment by setting up password validate component, password validation policy, removing anonymous users, disabling remote root login and removing test databases.
    Bash
    mysql_secure_installation
    
  5. Login to mysql-server. Hit enter when asked for a password.
    Bash
    mysql -uroot -p
    
  6. Create initial database for Zabbix with users fo localhost, zabbix servers and with password as mu)dyMusic13.
    MySQL
    create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;
    create user zabbix@localhost identified by 'mu)dyMusic13';
    grant all privileges on zabbix_proxy.* to zabbix@localhost;
    set global log_bin_trust_function_creators = 1;
    quit;
    
  7. Import schemas for the database that's just created using the same credentials from previous step.
    Bash
    cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix_proxy
    
  8. Login to mysql-server as root and disable log_bin_trust_function_creators option and enable log expiry in 3 days.
    MySQL
    set global log_bin_trust_function_creators = 0;
    set global expire_logs_days = 3;
    quit;
    
  9. Configure bin log size and log expiry for mysql-server by appending following config.
    /etc/mysql/mysql.conf.d/mysqld.cnf
    max_binlog_size   = 100M
    # binlog_do_db          = include_database_name
    # binlog_ignore_db      = include_database_name
    expire_logs_days = 3
    
  10. Configure database for proxy /etc/zabbix/zabbix_proxy.conf

    • Server=zbsrv1.aadya.tech;zbsrv2.aadya.tech
    • Hostname=zbpr1.aadya.tech
    • DBPassword=mu)dyMusic13
  11. Restart and enable autostart for Zabbix Proxy.

    Bash
    systemctl restart zabbix-proxy
    systemctl enable --now zabbix-proxy
    

  12. Repeat steps 1-11 on zbpr2, but with Hostname=zbpr1.aadya.tech in /etc/zabbix/zabbix_proxy.conf