A Zabbix agent is a program that runs on a remote machine that needs to be monitored 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.
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.
In this article, we will learn how to install the Zabbix agent on OpenSUSE Leap 15.3 Server.
Also check:
- How to Add Host in Zabbix Server to Monitor
- How to Install Zabbix Agent 6 on OpenSUSE Leap 15.3
- How to Install Zabbix Agent on Rocky Linux/Alma Linux 8
- How To Install and Configure Zabbix Agent on Ubuntu 20.04
- How to Install and Configure Zabbix Server 6 on Ubuntu 20.04
Table of Content
- Ensure that the server is up to date
- Install the Zabbix Agent
- Configure Zabbix Agent
- Adjust firewall for Zabbix
- Start and enable the Zabbix agent
1. Ensure that the server packages are up to date
Before proceeding, let us make sure that our server packages are up to date with this command:
sudo zypper refresh
sudo zypper update -y
Let us also install some common packages that we will need
sudo zypper install -y vim
2. Install the Zabbix Agent
The Zabbix agent packages are not available under the default OpenSUSE repositories. We will need to configure the Zabbix repository in our system before installing the agent.
The latest Zabbix version as at the writing of this article is Zabbix version 5.4. Install the repository configuration package. This package contains yum (software package manager) configuration files.
sudo rpm -Uvh --nosignature https://repo.zabbix.com/zabbix/5.4/sles/15/x86_64/zabbix-release-5.4-1.sles15.noarch.rpm
sudo zypper --gpg-auto-import-keys refresh 'Zabbix Official Repository'
Once the repository is installed, we can install the agent. Use this command:
sudo zypper install -y zabbix-agent
Confirm the software version installed:
~> rpm -qi zabbix-agent
Name : zabbix-agent
Version : 5.4.9
Release : 1.sles15
Architecture: x86_64
Install Date: Sat Jan 22 14:15:34 2022
Group : Applications/Internet
Size : 2108182
License : GPLv2+
Signature : RSA/SHA512, Thu Dec 23 12:54:41 2021, Key ID 082ab56ba14fe591
Source RPM : zabbix-5.4.9-1.sles15.src.rpm
Build Date : Thu Dec 23 12:37:01 2021
Build Host : builds.zabbix.lan
Relocations : (not relocatable)
URL : http://www.zabbix.com/
Summary : Zabbix Agent
Description :
Old implementation of zabbix agent.
To be installed on monitored systems.
Distribution: (none)
3. Configure Zabbix Agent
Now, you need to configure the Agent service to allow Zabbix server requests. We will also update the Hostname so we know which server we configured the agent on. Edit the Zabbix agent configuration file by adding the Zabbix server IP.
sudo vim /etc/zabbix/zabbix_agentd.conf
Add this content:
Server=10.70.5.218
ServerActive=10.70.5.218
Hostname=dev-susesrv
In the “Server
” and “ServerActive
” parameters put the IP address of your Zabbix server or proxy!
4.Adjust Firewall for Zabbix
If you have firewall installed and enabled, 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
5. Start and enable the Zabbix agent
We can now start the agent. Use this command to start:
sudo systemctl start zabbix-agent
Check the status to confirm that it is started.
~> sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2022-01-22 14:17:06 UTC; 15s ago
Process: 3191 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 3193 (zabbix_agentd)
Tasks: 6 (limit: 4587)
CGroup: /system.slice/zabbix-agent.service
├─3193 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─3194 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─3195 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─3196 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─3197 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─3198 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Jan 22 14:17:06 dev-susesrv.inv.re systemd[1]: Starting Zabbix Agent...
Jan 22 14:17:06 dev-susesrv.inv.re systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start>
Jan 22 14:17:06 dev-susesrv.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:
sudo systemctl enable zabbix-agent
That is it! You have successfully installed Zabbix Agent on your OpenSUSE Leap 15.3. You can now proceed to add host in Zabbix server to be monitored. Checkout this guide How to Add Host in Zabbix Server to Monitor.