Zabbix Agent is a process that runs on remote machines, which need to monitor through the Zabbix server. The agent collects the data on the remote server and send back to Zabbix server when requested. Zabbix agent must be installed on all the remote systems that need to be monitor through the Zabbix server.
Basically, there are two types of checks:
- Passive Check – Zabbix Agent sent data to server on their request.
- Active Check – Zabbix Agent sends data periodically to server.
After installing zabbix server on your system. Now we are moving to install agent on remote system’s. This article will help you to install zabbix agent on CentOS/RHEL 8 Linux systems. After completing this step go to next article add Host in Zabbix Server.
Step 1 – Disable SELinux
By default, SELinux is enabled in CentOS 8. You can disable the SELinux to work Zabbix properly on your CentOS machine.
You can disable the SELinux by editing /etc/selinux/config file:
Change the following line:
Press CTRL + O to save changes and then CTRL + X to close file. Then restart your server to apply changes.
Step 2 – Installing Zabbix Agent
The Zabbix agent packages are not available under the default CentOS 8 repositories. So first, you will need to configure the Zabbix repository in your system.
At the time of writing this tutorial, the latest version of Zabbix is Zabbix 4.4. You can install the Zabbix 4.4 repository package by running the following command:
dnf install https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm
After installing yum repository packages in our system. Use the following command to install the Zabbix agent on your CentOS 8 or RHEL 8 systems using the package management tool.
dnf install zabbix-agent
Press ‘Y’ for any confirmation to complete the installation process.
Step 3 – Configure Zabbix Agent
Now, you need to configure the Agent service to allow Zabbix server requests. Edit the Zabbix agent configuration file by adding the Zabbix server IP.
#Server=[zabbix server ip] #Hostname=[ Hostname of client system ] Server=192.168.1.100 Hostname=Server1
Step 4 – Adjust Firewall for Zabbix
Next, you will need to allow the Zabbix ports 10050 and 10051. and HTTP service through the firewall. You can allow them with the following command:
firewall-cmd --permanent --add-port=10050/tcp firewall-cmd --reload
Step 5 – Start Zabbix Agent
Your zabbix agent service is ready to run. Execute the following commands to enable service to auto start on system boot. Then also start service for the first time:
systemctl enable zabbix-agent systemctl start zabbix-agent
To stop zabbix-agent service anytime run the following command:
systemctl stop zabbix-agent