Continuing the Zabbix series, this tutorial will guide you on how you can install and configure Zabbix agents on Linux (Debian-based systems and RHEL-based distros) in order to actively monitor local resources on remote systems.
The main job of Zabbix agents consists in gathering local information from the targets where they run and sending the data to a central Zabbix server to be further processed and analyzed.
Requirements
Install and Configure Zabbix on Debian/Ubuntu and RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux.
- How to Install Zabbix on RHEL/CentOS and Debian/Ubuntu – Part 1
- How to Configure Zabbix to Send Email Alerts to Gmail Account – Part 2
Step 1: Install Zabbix Agents in Linux Systems
1. Depending on the Linux distribution you are running, go to the Zabbix download page, grab the latest version of the available agent’s binary packages using a tool such as wget or curl and install it on your machine using the distribution-specific package manager – Yum, Rpm or Dpkg.
For Debian/Ubuntu systems (including latest releases) use the following steps to download and install Zabbix Agent:
Install Zabbix Agent in Debian
----------------- <strong>On Debian 11</strong> ----------------- $ wget https://repo.zabbix.com/zabbix/5.4/debian/pool/main/z/zabbix/zabbix-agent2_5.4.6-1 debian11_amd64.deb $ sudo dpkg -i zabbix-agent2_5.4.6-1 debian11_amd64.deb ----------------- <strong>On Debian 10</strong> ----------------- $ wget https://repo.zabbix.com/zabbix/5.4/debian/pool/main/z/zabbix/zabbix-agent2_5.4.6-1 debian10_amd64.deb $ sudo dpkg -i zabbix-agent2_5.4.6-1 debian10_amd64.deb
Install Zabbix Agent in Ubuntu
----------------- <strong>On Ubuntu 20.04</strong> ----------------- $ wget https://repo.zabbix.com/zabbix/5.4/ubuntu/pool/main/z/zabbix/zabbix-agent_5.4.7-1 ubuntu20.04_amd64.deb $ sudo dpkg -i zabbix-agent_5.4.7-1 ubuntu20.04_amd64.deb ----------------- <strong>On Ubuntu 18.04</strong> ----------------- $ wget https://repo.zabbix.com/zabbix/5.4/ubuntu/pool/main/z/zabbix/zabbix-agent_5.4.7-1 ubuntu18.04_amd64.deb $ sudo dpkg -i zabbix-agent_5.4.7-1 ubuntu18.04_amd64.deb
Install Zabbix On RHEL-based Systems
For RHEL alike systems, download the .rpm packaged for the distribution-specific release number, using the same page as above, and install it using rpm package manager.
In order to automatically manage missing dependency issues and install the agent using one-shot use the yum command followed by the binary package download link, as in the example below used for installing the agent on CentOS 8:
----------------- <strong>On RHEL 8</strong> ----------------- # rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-agent-5.4.6-1.el8.x86_64.rpm ----------------- <strong>On RHEL 7</strong> ----------------- # rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-agent-5.4.6-1.el7.x86_64.rpm
Step 2: Configure and Test Zabbix Agent in Linux
2. The next logical step after installing the packages on the system is to open the Zabbix agent configuration file located in /etc/zabbix/ system path on both major distributions and instruct the program to send all the collected information to the Zabbix server in order to be analyzed and processed.
Therefore, open the zabbix_agentd.conf file with your favorite text editor, find the below lines (use the screenshots as a guide), uncomment them and make the following changes:
# nano /etc/zabbix/zabbix_agentd.conf
add Zabbix server IP address and hostname as shown below.
Server=IP of Zabbix Server ServerActive=IP of Zabbix Server Hostname=use the FQDN of the node where the agent runs
3. Once you’ve finished editing the Zabbix agent configuration file with the required values, restart the daemon using the following command, then use the netstat command to verify if the daemon has been started and operates on the specific port – 10050/tcp:
$ sudo systemctl restart zabbix-agent $ sudo netstat -tulpn|grep zabbix
For older distributions use the service command to manage Zabbix agent daemon:
$ sudo service zabbix-agent restart $ sudo netstat -tulpn|grep zabbix
4. If your system is behind a firewall then you need to open 10050/tcp port on the system in order to reach through the Zabbix server.
For Debian based systems, including Ubuntu, you can use the ufw tool to open the port and on RHEL-based, you can use Firewalld utility to manage the firewall rules as the below examples:
$ sudo ufw allow 10050/tcp [On <strong>Debian</strong> based systems]
$ sudo firewall-cmd --add-port=10050/tcp --permanent [On <strong>RHEL</strong> based systems]
For older distributions such as RHEL/CentOS 6 or unmanaged firewalls through specific utilities use the powerful iptables command to open ports:
# iptables -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT
5. Finally, in order to test if you can reach Zabbix Agent from Zabbix Server, use Telnet command from Zabbix server machine to the IP addresses of the machines that run the agents, as illustrated below (don’t worry about the thrown error from agents):
# telnet zabbix_agent_IP 10050
Step 3: Add Zabbix Agent Monitored Host to Zabbix Server
6. On the next step it’s time to move to the Zabbix server web console and start adding the hosts which run zabbix agent in order to be monitored by the server.
Go to Configuration -> Hosts -> Create Host -> Host tab and fill the Hostname field with the FQDN of the monitored Zabbix agent machine, use the same value as above for the Visible name field.
Next, add this host to a group of monitored servers and use the IP Address of the monitored machine at the Agent interfaces field – alternatively you can also use DNS resolution if it’s the case. Use the below screenshots as a guide.
7. Next, move to the Templates tab and hit Select. A new window with templates should open. Choose Template OS Linux then scroll down and hit on Select button to add it and automatically close the window.
8. Once the template appears to Link the new template box, hit on Add text to link it to Zabbix server, then hit on the lower Add button to finish the process and completely add the monitored host. The visible name of the monitored host should now appear hosts window.
That’s all! Just assure that the host Status is set to Enabled and wait a few minutes in order for the Zabbix server to contact the agent, process the received data, and inform or eventually alert you if something goes bad on the monitored target.
The above is the detailed content of How to Install Zabbix Agents on Remote Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Gogo is a remarkable tool to bookmark directories inside your Linux shell. It helps you create shortcuts for long and complex paths in Linux. This way, you no longer need to type or memorize lengthy paths on Linux.For example, if there's a directory

PPA is an important tool for Ubuntu users to expand their software sources. 1. When searching for PPA, you should visit Launchpad.net, confirm the official PPA in the project official website or document, and read the description and user comments to ensure its security and maintenance status; 2. Add PPA to use the terminal command sudoadd-apt-repositoryppa:/, and then run sudoaptupdate to update the package list; 3. Manage PPAs to view the added list through the grep command, use the --remove parameter to remove or manually delete the .list file to avoid problems caused by incompatibility or stopping updates; 4. Use PPA to weigh the necessity and prioritize the situations that the official does not provide or require a new version of the software.

LXD is described as the next-generation container and virtual machine manager that offers an immersive for Linux systems running inside containers or as virtual machines. It provides images for an inordinate number of Linux distributions with support

How to quickly generate test files of a specified size? It can be achieved using command line tools or graphical software. On Windows, you can use fsutilfilecreatenew file name size to generate a file with a specified byte; macOS/Linux can use ddif=/dev/zeroof=filebs=1Mcount=100 to generate real data files, or use truncate-s100M files to quickly create sparse files. If you are not familiar with the command line, you can choose FSUtilGUI, DummyFileGenerator and other tool software. Notes include: pay attention to file system limitations (such as FAT32 file size upper limit), avoid overwriting existing files, and some programs may

Node Version Manager (NVM) is a simple bash script that helps manage multiple Node.js versions on your Linux system. It enables you to install various Node.js versions, view available versions for installation, and check already installed versions.NV

The key to installing dual systems in Linux and Windows is partitioning and boot settings. 1. Preparation includes backing up data and compressing existing partitions to make space; 2. Use Ventoy or Rufus to make Linux boot USB disk, recommend Ubuntu; 3. Select "Coexist with other systems" or manually partition during installation (/at least 20GB, /home remaining space, swap optional); 4. Check the installation of third-party drivers to avoid hardware problems; 5. If you do not enter the Grub boot menu after installation, you can use boot-repair to repair the boot or adjust the BIOS startup sequence. As long as the steps are clear and the operation is done properly, the whole process is not complicated.
