In this guide, I will show you how to install Zabbix Agent on Linux.
Ubuntu
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
apt update
apt install zabbix-agent
RHEL & Centos
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/$(rpm -E %{rhel})/x86_64/zabbix-release-5.0-1.el$(rpm -E %{rhel}).noarch.rpm
yum install zabbix-agent
Debian
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
apt update
apt install zabbix-agent
Configure Zabbix agent
Now we just need to configure the Zabbix agent by adding Zabbix server IP to the configuration file /etc/zabbix/zabbix_agentd.conf
Server=zabbix.unihost.com
Hostname=server.hostname
Configure firewall
Zabbix agent, that is running in passive mode, must be able to respond to the Zabbix server inquiries over TCP port 10050.
Iptables
iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
RedHat / Centos
firewall-cmd --permanent --zone=public --add-port=10050/tcp
firewall-cmd --reload
Ubuntu / Debian
ufw allow 10050/tcp
Start Zabbix agent
systemctl enable --now zabbix-agent