6.1. Zabbix | Grafana Installation

If you wish to manually download the SQL Files:
  1. Install Zabbix Repository

    # If you have a proxy you have to set it up in /etc/wget.rc
    
    wget https://repo.zabbix.com/zabbix/5.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.2-1+ubuntu20.04_all.deb
    dpkg -i zabbix-release_5.2-1+ubuntu20.04_all.deb
    apt update
    
  2. Install Latest Postgres Repo

    sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    sudo apt-get -y install postgresql
    
  3. Install Zabbix SV-Frontend-Agent

    apt install zabbix-server-pgsql zabbix-frontend-php php7.4-pgsql zabbix-apache-conf zabbix-agent
    
  4. Set default DB template to UTF8 in Postgres

    wget https://docs.brconsulting.info/_static/downloads/zabbix/00-zbx-grf-install/01-zbx-set-psql-utf8-default.sql
    chmod 755 01-zbx-set-psql-utf8-default.sql
    su  postgres
    psql < 01-zbx-set-psql-utf8-default.sql
    
  5. Create initial Zabbix DB

    sudo -u postgres createuser --pwprompt zabbix
    sudo -u postgres createdb -O zabbix zabbix
    
  6. Import Initial Zabbix DB Schema and data

    zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
    
  7. Configure DB for Zabbix Server

    Edit file /etc/zabbix/zabbix_server.conf
            DBPassword=password
    
  8. Start Zabbix Services

    systemctl restart zabbix-server zabbix-agent apache2
    systemctl enable zabbix-server zabbix-agent apache2
    
  9. Go to http://[ServerIP]/zabbix

  10. If your desired locale is not installed do

    dpkg-reconfigure locales
    systemctl restart apache2
    
  11. Log in with Admin (User) / zabbix (Pwd)
    • Create Admin API user for Grafana (If grafana installed) with SUPER ADMIN PERMISSIONS and NO FRONT END ACCESS

  12. Add Grafana repositories

    sudo apt-get install -y apt-transport-https
    sudo apt-get install -y software-properties-common wget
    wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
    echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
    
    
    sudo apt-get update
    sudo apt-get install grafana-enterprise
    
  13. Start the Grafana Server

    systemctl daemon-reload
    systemctl start grafana-server
    systemctl enable grafana-server
    
  14. Log in for the first time to http://[ServerIP]:3000/
    • Default User: admin

    • Default Pwd: admin

  15. Go back to the terminal and install the Zabbix Datasource Plugin

    grafana-cli plugins install alexanderzobnin-zabbix-app
    systemctl restart grafana-server
    
  16. Enable it by heading to the Plugins section and enabling it!

  17. Add Zabbix’s PostgreSQL DB as a Datasource (Optional)

    • Create DB User and Grant read access to it

    Then do the following:

    wget https://docs.brconsulting.info/_static/downloads/zabbix/00-zbx-grf-install/02-zbx-allow-grafana-select.sql
    chmod 755 02-zbx-allow-grafana-select.sql
    su  postgres
    psql < 02-zbx-allow-grafana-select.sql
    
    • Add Datasource on Grafana

    • Disable SSL Mode (Out of tutorial Scope)

  18. Add Zabbix Datasource (API - Requires Admin user)