Install and Configure Zabbix Monitoring

Tech Stack

  • Zabbix Monitoring

  • PostgreSQL

  • Nginx

Common Problems

Install Zabbix Repository

$ wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
$ dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
$ apt update

Install Zabbix Agent, Frontend, and Server

$ apt install zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent

Create Initial Database

$ sudo -u postgres createuser --pwprompt zabbix
$ sudo -u postgres createdb -O zabbix zabbix

Import Initial Schema

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

Configure Database for Zabbix Server

$ nano /etc/zabbix/zabbix_server.conf
DBPassword=<password>

Configure Nginx for Zabbix Frontend

$ nano /etc/zabbix/nginx.conf
listen 8080;
server_name regiapriandi.com;
$ cp -r /etc/zabbix/nginx.conf /etc/nginx/site-enabled/

Start Zabbix agent and server process

$ systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
$ systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm