Skip to content

Zabbix

Install Zabbix

Install zabbix on ubuntu 22.04:

run shell as root:

1
sudo -s

install Zabbix repo

1
2
3
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
apt update

Install Zabbix server, frontend, agent

1
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

Install MySQL if running database on same server:

1
apt install mysql-server

Create initial database

1
2
3
4
5
6
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;

On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.

1
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 after importing database schema:

1
2
3
4
mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

Configure database for zabbix server: Edit file /etc/zabbix/zabbix_server.conf

1
2
3
nano /etc/zabbix/zabbix_server.conf
#add to file:
DBPassword=password

Start Zabbix server and agent processes and make it start at system boot:

1
2
systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2

Install Zabbix Agent and configure

Install with the following commands:

Install Zabbix repo

1
2
3
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
sudo apt update

Install Agent

1
sudo apt install zabbix-agent

Configure Zabbix Agent

1
sudo nano /etc/zabbix/zabbix_agentd.conf

Replace the following variables with those required in the deployment:

1
2
3
Server=
ServerActive=
Hostname=

Start and enable agent service:

1
2
sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent