Install Zabbix Agent on Ubuntu on Same Network as Zabbix Server

Video Lecture

Install Zabbix Agent on Ubuntu on Same Network as Zabbix Server Install Zabbix Agent on Ubuntu on Same Network as Zabbix Server Install Zabbix Agent on Ubuntu on Same Network as Zabbix Server

Description

I install Zabbix Agent on an Ubuntu 16.04.

I first need to download and install the repository on the server.

The page with these instructions are at

https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/debian_ubuntu

1
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
1
dpkg -i zabbix-release_5.0-1+focal_all.deb
1
apt update

After that, I then run

1
sudo apt install zabbix-agent

Now to configure the agent,

1
sudo nano /etc/zabbix/zabbix_agentd.conf

Edit parameters for Server, ServerActive and Hostname and save.

Then,

1
sudo service zabbix-agent start

or if it was already running after install then

1
sudo service zabbix-agent restart

Now to configure a new host on the Zabbix Server itself.

After that,

then go back to the server with the new agent and restart the agent

1
sudo service zabbix-agent restart

If Zabbix server is reporting an error about connection failure, you can check the zabbix agent log file using

1
tail -f /var/log/zabbix/zabbix_agentd.log

Zabbix 5.0

Ubuntu 20.04 Focal

1
2
3
4
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
dpkg -i zabbix-release_5.0-1+focal_all.deb
apt update
apt install zabbix-agent

Ubuntu 18.04 Bionic

1
2
3
4
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+bionic_all.deb
dpkg -i zabbix-release_5.0-1+bionic_all.deb
apt update
apt install zabbix-agent

Ubuntu 16.04 Xenial

1
2
3
4
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+xenial_all.deb
dpkg -i zabbix-release_5.0-1+xenial_all.deb
apt update
apt install zabbix-agent

Centos 8

1
2
3
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
dnf clean all
dnf install zabbix-agent

Centos 7

1
2
3
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
yum install zabbix-agent

Zabbix 4.4

Ubuntu 20.04 Focal

1
2
3
4
wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+focal_all.deb
dpkg -i zabbix-release_4.4-1+focal_all.deb
apt update
apt install zabbix-agent

Ubuntu 18.04 Bionic

1
2
3
4
wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+bionic_all.deb
dpkg -i zabbix-release_4.4-1+bionic_all.deb
apt update
apt install zabbix-agent

Ubuntu 16.04 Xenial

1
2
3
4
wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+xenial_all.deb
dpkg -i zabbix-release_4.4-1+xenial_all.deb
apt update
apt install zabbix-agent

Centos 8

1
2
3
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm
dnf clean all
dnf install zabbix-agent

Centos 7

1
2
3
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum clean all
yum install zabbix-agent

Troubleshooting Agent Setup

Ensure your hostname in the Zabbix UI matches the Hostname in the agents config file.

For passive checks, the Zabbix server should be able to ping the agent by the ip address or domain name you set up in the host configuration interface fields. And that you can telnet, from the Zabbix server (or Zabbix Proxy, if configured to use a proxy), to the port (default 10050), that the agent process is listening on.

For active checks, the server with the agent running, should be able to ping the ip address, or domain name you've set in the ServerActive parameter in the agents configuration file. This address will be the Zabbix Server, and/or the Zabbix Proxy. It should also be able to telnet to the Zabbix Server/Proxy port (default 10051)

To read the Zabbix Agent log files on the host,

1
tail -f /var/log/zabbix/zabbix_agentd.log

To read the Zabbix Server logs, on the Zabbix Server type,

1
tail -f /var/log/zabbix/zabbix_server.log