A Zabbix agent is a lightweight service that runs on a host you want to monitor. It collects metrics (CPU, memory, disk, processes, logs, etc.) and provides them to the Zabbix server either on demand or on a schedule.
In this guide, you’ll install and configure the Zabbix Agent on Rocky Linux / AlmaLinux 8 or 9, then enable the service so it starts automatically on boot.
There are two types of checks:
- Passive checks: the Zabbix server/proxy connects to the agent (default port
10050) and requests data. - Active checks: the agent connects out to the Zabbix server/proxy and sends data periodically.
If you also need the server side, check out this guide: How to Install and Configure Zabbix Server 5 on Rocky Linux/Alma Linux 8.
Related content:
- How to Install and Configure Zabbix Server 6 on Ubuntu 20.04
- How To Install and Configure Zabbix Agent 5 on Ubuntu 20.04
- How to Install Zabbix Agent 6 on Rocky Linux/Alma Linux/Oracle Linux 8
- How to Install Zabbix Agent 6 on OpenSUSE Leap 15.3
- How to Add Host in Zabbix Server to Monitor
Ensure the server packages are up to date
Before proceeding, let us make sure that our server packages are up to date with this command:
| |
Let us also install some common packages that we will need:
| |
Install the Zabbix Agent
The Zabbix agent packages are not available under the default Rocky Linux 8 repositories. We will need to configure the Zabbix repository in our system before installing the agent.
At the time this article was written, the Zabbix 5.4 repository was current. If you want a newer major version, use the appropriate repo (for example Zabbix 6.x/7.x) and package names from Zabbix.
Install the Zabbix 5.4 repository using this command:
| |
Once the repository is installed, we can install the agent:
| |
Confirm the software version installed:
| |
Configure Zabbix Agent
Now configure the agent so it knows which Zabbix server/proxy to talk to, and so the host is identified correctly.
Edit the Zabbix agent configuration file:
| |
Update (or add) these settings (replace the IP and hostname with your values):
| |
Notes:
Serveris used for passive checks (server/proxy connects to the agent).ServerActiveis used for active checks (agent connects out to server/proxy).Hostnamemust match the host name you create in the Zabbix UI (unless you use auto-registration).
Adjust the firewall (if enabled)
If firewalld is enabled, allow inbound TCP port 10050 so the server/proxy can reach the agent for passive checks.
Note: port 10051 is used by the Zabbix server/proxy, not the agent, so you usually do not need it open on an agent host.
| |
SELinux
You do not need to disable SELinux just to run the Zabbix agent. The “frontend in a browser” applies to the Zabbix server host, not the agent host.
If you run into SELinux-related issues, check logs with sudo ausearch -m AVC -ts recent and address the specific denial rather than setting the whole system to permissive.
Start and enable the Zabbix agent
Start the agent (it is not started by default):
| |
Check the status to confirm that it is started.
| |
From the above output, we can confirm that the agent is running. To enable the agent to start on boot, use this command:
| |
Next steps
That is it. You have successfully installed the Zabbix Agent on your Rocky Linux/AlmaLinux machine. You can now add this host in Zabbix for monitoring. Check out this guide: How to Add Host in Zabbix Server to Monitor.