Installation can be done either manually (for networks without Internet access) by downloading and installing the package from the official repository <http://repo.zabbix.com/zabbix/5.4/ubuntu/pool/main/z/zabbix/>`__ or by adding the Zabbix repository itself and subsequent installation using a package manager.
To do this, you need to download a package containing repository data and a GPG key and install it on the system.
wget -P /tmp https://repo.zabbix.com/zabbix/5.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.4-1%2Bubuntu20.04_all.deb
sudo dpkg -i /tmp/zabbix-release_5.4-1+ubuntu20.04_all.deb
sudo apt update
sudo apt install zabbix-agent
After installation, you need to generate a PSK key to encrypt data from the agent:
openssl rand -hex 32 > /etc/zabbix/secret.psk
Minimum configuration /etc/zabbix/zabbix-agent.conf:
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
# Общие настройки для работы в активном и пассивном режимах.
# В HOSTNAME подставить имя текущего узла.
Server=ZABBIX_SERVER_IP
ServerActive=ZABBIX_SERVER_IP
Hostname=HOSTNAME
Include=/etc/zabbix/zabbix_agentd.d/*.conf
# Пользовательские параметры для выполнения проверок по службам
UserParameter=sysd.service[*],systemctl is-active --quiet '$1' && echo 1 || echo 0
UserParameter=sysd.service.instance[*],systemctl is-active --quiet '$1'@'$2' && echo 1 || echo 0
# Метод шифрования данных, если необходимо.
# В HOSTNAME подставить имя текущего узла.
TLSConnect=psk
TLSAccept=psk
TLSPSKIdentity=HOSTNAME
TLSPSKFile=/etc/zabbix/secret.psk
After changing the configuration, you need to restart the service and enable its autostart using the commands:
sudo systemctl restart zabbix-agent
sudo systemctl enable zabbix-agent