How to Install Zabbix Agent on Rocky Linux/Alma Linux 8/9

Step-by-step guide on how to install and configure the Zabbix Agent on Rocky Linux or AlmaLinux 8/9.

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:

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:

1
sudo dnf -y update

Let us also install some common packages that we will need:

1
sudo dnf install -y vim

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:

1
sudo dnf install -y https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm

Once the repository is installed, we can install the agent:

1
sudo dnf install -y zabbix-agent

Confirm the software version installed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
rpm -qi zabbix-agent

Name        : zabbix-agent
Version     : 5.4.9
Release     : 1.el8
Architecture: x86_64
Install Date: Mon 17 Jan 2022 06:23:27 AM UTC
Group       : Applications/Internet
Size        : 2353430
License     : GPLv2+
Signature   : RSA/SHA512, Thu 23 Dec 2021 12:54:16 PM UTC, Key ID 082ab56ba14fe591
Source RPM  : zabbix-5.4.9-1.el8.src.rpm
Build Date  : Thu 23 Dec 2021 12:28:37 PM UTC
Build Host  : 3a869a1545a8
Relocations : (not relocatable)
URL         : http://www.zabbix.com/
Summary     : Old Zabbix Agent
Description :
Old implementation of zabbix agent.
To be installed on monitored systems.

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:

1
sudo vim /etc/zabbix/zabbix_agentd.conf

Update (or add) these settings (replace the IP and hostname with your values):

1
2
3
Server=10.70.5.218
ServerActive=10.70.5.218
Hostname=dev-rockysrv1

Notes:

  • Server is used for passive checks (server/proxy connects to the agent).
  • ServerActive is used for active checks (agent connects out to server/proxy).
  • Hostname must 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.

1
2
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --reload

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):

1
sudo systemctl start zabbix-agent

Check the status to confirm that it is started.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sudo systemctl status zabbix-agent

â—Ź zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-01-17 06:57:33 UTC; 19s ago
  Process: 39725 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 39728 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 39730 (zabbix_agentd)
    Tasks: 6 (limit: 23176)
   Memory: 3.9M
   CGroup: /system.slice/zabbix-agent.service
           /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           /usr/sbin/zabbix_agentd: collector  [idle 1 sec]
           /usr/sbin/zabbix_agentd: listener #1  [waiting for connection]
          /usr/sbin/zabbix_agentd: listener #2  [waiting for connection]
           /usr/sbin/zabbix_agentd: listener #3  [waiting for connection]
           /usr/sbin/zabbix_agentd: active checks #1  [idle 1 sec]

Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: zabbix-agent.service: Succeeded.
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Stopped Zabbix Agent.
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Starting Zabbix Agent...
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Started Zabbix Agent.

From the above output, we can confirm that the agent is running. To enable the agent to start on boot, use this command:

1
sudo systemctl enable zabbix-agent

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.

Last updated on Jan 18, 2026 10:21 +0300
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy