How-To: Installation and Integration of Zabbix and Grafana

AI Preview

Is this content worth your time? Use the quick preview to decide.

Hi everyone,

In this guide, we install Zabbix with PostgreSQL and connect it to Grafana on two Ubuntu servers. We use the official package repositories, configure the database and web interface, and then set up the Zabbix data source in Grafana.

To verify the integration, we compare the Zabbix server uptime metric in Zabbix and a Grafana dashboard. We also explain the role of database credentials and a few connection-security options encountered during setup.

🔗 Helpful Links
  • There are no helpful links in this one.

Video Tutorial

Used Commands


Update package lists

sudo apt update

Install PostgreSQL database

sudo apt install -y postgresql

Add official Zabbix repository

wget https://repo.zabbix.com/zabbix/7.4/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.4+ubuntu26.04_all.deb
sudo dpkg -i zabbix-release_latest_7.4+ubuntu26.04_all.deb

Refresh repository package lists

sudo apt update

Install Zabbix components

sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.5-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2

Verify Zabbix version

zabbix_server --version

Create PostgreSQL user

sudo -u postgres createuser --pwprompt zabbix

Create Zabbix database

sudo -u postgres createdb -O zabbix -E UTF8 -T template0 zabbix

Import initial database schema

zcat /usr/share/zabbix/sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix

Configure Zabbix server

sudo nano /etc/zabbix/zabbix_server.conf

Configure Nginx frontend

sudo nano /etc/zabbix/nginx.conf

Enable and restart services

sudo systemctl enable zabbix-server zabbix-agent2 nginx php8.5-fpm
sudo systemctl restart zabbix-server zabbix-agent2 nginx php8.5-fpm

Check Zabbix server status

sudo systemctl status zabbix-server --no-pager

Install required tools

sudo apt-get install -y apt-transport-https wget gnupg

Add Grafana signing key

sudo mkdir -p /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/grafana.asc https://apt.grafana.com/gpg-full.key
sudo chmod 644 /etc/apt/keyrings/grafana.asc

Add and refresh Grafana repository

echo "deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt-get update

Install Grafana package

sudo apt-get install grafana

Start and enable Grafana

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server

Quiz


QUIZ-EN-How-To-Installation-and-Integration-of-Zabbix-and-Grafana-5
  • Question
  • Question
  • Question
  • Question
  • Question

Full Transcript

Rating

Post Rating (EN)
Scroll to Top