We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Configure Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8

Learn how to – Configure Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8.

Zabbix is a free and open-source tool used to provide a robust and real-time monitoring solution of your network and applications. This is important because it helps identify errors as soon as they occur and send alerts. This results in taking measures in time and therefore guarantees business continuity.

Zabbix agent is the client software. It is installed on the client machine to collect the monitoring data. Furthermore, it can monitor standard services that include web services, e-mail e.t.c. The Zabbix agent is able to run on devices with limited resources. In the Zabbix Client-server set up, all configurations are centralized in the Zabbix server. This makes it easier to manage Zabbix agents with a single config file.

The Zabbix agent supports both active checks (trapping) and passive (polling). Passive checks(polling) the server requests a value from the Zabbix agent and the agent return the value to the server. In the active checks (trapping), the Zabbix agent requests a list of active checks from the Zabbix server then the agent sends the results periodically.

The diagram below illustrates how the passive and active checks occur.

This guide aims to demonstrate how to install and configure Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8.

Getting Started

For this guide, I assume you already have the Zabbix 5 server already installed and configured on your Rocky Linux | AlmaLinux 8 system. Otherwise, use the dedicated guide below to install and configure Zabbix Server on Rocky Linux | AlmaLinux 8.

Step 1 – Install Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8

Installing the Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8 can be achieved using the below steps:

1. Add the Zabbix Agent Repository

Zabbix Agent is not available in the default Rocky Linux 8 | AlmaLinux 8 base repository and therefore, we need to add the repository below in order to install it.

sudo rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

The installation should proceed as below.

Retrieving https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
warning: /var/tmp/rpm-tmp.Tu3Hlj: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Verifying...                                                            (1################################# [100%]
Preparing...                                                            (1################################# [100%]
Updating / installing...
   1:zabbix-release-5.0-1.el8                                           ( ################################# [100%]

2. Install Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8

With the repository for Zabbix 5 Agent added to your system, install it using the command below.

sudo yum install vim zabbix-agent zabbix-sender

Sample Output:

Dependencies resolved.
==========================================================================
 Package             Architecture Version              Repository    Size
==========================================================================
Installing:
 zabbix-agent        x86_64       5.0.18-1.el8         zabbix       489 k
 zabbix-sender       x86_64       5.0.18-1.el8         zabbix       373 k

Transaction Summary
==========================================================================
Install  2 Packages

Total download size: 862 k
Installed size: 3.7 M
Is this ok [y/N]: y
.......
Zabbix Official Repository - x86_64       1.6 MB/s | 1.7 kB     00:00    
Importing GPG key 0xA14FE591:
 Userid     : "Zabbix LLC <packager@zabbix.com>"
 Fingerprint: A184 8F53 52D0 22B9 471D 83D0 082A B56B A14F E591
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
Is this ok [y/N]: y
......

Now that is it! You have successfully installed the Zabbix 5 agent on Rocky Linux 8 | AlmaLinux 8.

Step 2 – Configure Zabbix 5 Agent on Rocky Linux 8 | AlmaLinux 8

Now we will configure the Zabbix 5 Agent to be able to communicate with the Zabbix server.

The Zabbix agent configuration file is at /etc/zabbix/zabbix_agentd.conf. So we will edit the file and specify the Zabbix server details.

sudo vim /etc/zabbix/zabbix_agentd.conf

Edit the file as below, replacing appropriately.

# On line 117 - Specify Zabbix server IP Address
Server=192.168.205.2
.....
# On line 158 - Specify Zabbix server ( For active checks)
ServerActive=192.168.205.2
......
# On line 169 - Set server hostname reported by Zabbix agent
Hostname=agent1.ownyourlife.com.ng

Save the file after making the changes. Start and enable the Zabbix agent service to run on system boot.

sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent

Verify if the service is running perfectly:

$ 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 Fri 2021-12-17 04:06:23 EST; 9s ago
 Main PID: 32082 (zabbix_agentd)
    Tasks: 6 (limit: 36433)
   Memory: 3.7M
   CGroup: /system.slice/zabbix-agent.service
           ├─32082 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─32083 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─32085 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─32086 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─32087 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─32088 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Allow the port 10050/tcp on the firewall. This port is used by the Zabbix Agent daemon. If you are using firewalld, proceed as below.

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

Step 3 – Add the Zabbix Agent to the Zabbix Server

Now on the Zabbix server interface, navigate to Configuration > Hosts > Create host. Here, you will be required to provide the below details.

  • Hostname of the Zabbix agent to be monitored, it should match the one entered in the agent config file.
  • Visible name for the Zabbix agent.
  • Select the group or add a new group for “Groups” field.
  • IP address of the Zabbix agent
  • Zabbix agent service port , the default port is 10050

The details should be filled in as below.

Now click Add and your host should be added.

Step 4 – Add Monitoring templates

Templates are used to guide the Zabbix server on what to be monitored (active checks (trapping)). Now I will demonstrate how these templates can be added.

Navigate to the Configuration > Hosts, while here, click on the Zabbix agent you want to add templates to.

Click on Templates as shown.

Then click the select button to display a list of templates to select from.

Select the desired template and click Update to make the changes.

The monitoring data will then be collected and provided to you after a few minutes. You can view this data from the Zabbix server under Monitoring > Hosts. Here information is displayed, problems and graphs as well

The graphs appear as below.

Conclusion

That marks the end of this guide. We now have our server with Zabbix 5 agent installed and running perfectly. We have verified this by monitoring it from the Zabbix Server. Now enjoy the awesomeness of this Zabbix setup.

Interested in more?

Cart

Your Cart is Empty

Back To Shop