Tuesday, February 13, 2018

how to install and configure zabbix agent on linux ?

Zabbix Agent is required to install on all remote systems needs to monitor through Zabbix server. The Zabbix Agent collects resource utilization and applications data on the client system and provides such information to Zabbix server on their requests.
There are two types of checks can be configured between Zabbix Server and Client.
  • Passive check Zabbix Agent only sent data to server on their request.
  • Active check – Zabbix Agent sends data periodically to Server.
After installing zabbix server on your server, this article will help you to install zabbix agent on Ubuntu 16.04 LTS, 14.04 LTS, and Debian 9/8 systems. After completing this below steps go to next article add host in zabbix server.
Step 1 – Enable Apt Repository
Zabbix apt repositories are available on Zabbix official website. Add the repository to install required packages for Zabbix agent using the following command. For the older version of Ubuntu 12.04 LTS can download and install Zabbix agent version 2.2.
On Ubuntu systems & Debian
In RHEL system
Step 2 – Install Zabbix Agent
As you have successfully added Zabbix apt repositories in your system let’s use the following command to install Zabbix agent using the following command
On Ubuntu & Debian based systems
sudo apt-get update
sudo apt-get install zabbix-agent
In RHEL Based Systems.
rpm -Uvh  zabbix-agent-3.4.0-1.el7.x86_64.rpm
Step 3 – Edit Zabbix Agent Configuration
After installing completed of Zabbix aget. Edit zabbix agent configuration file /etc/zabbix/zabbix_agentd.conf and update Zabbix server ip
#Server=[zabbix server ip]
#Hostname=[Hostname of client system ]

Server=IP of Zabbix Server
ServerActive=IP of Zabbix Server
Hostname=use the hostname of the node where the agent runs
Step 4 – Adding port 10050 to firewall
If your system is behind a firewall then you need to open 10050/tcp port on the system in order to reach through Zabbix server.
For Debian based systems, including Ubuntu, you can use ufw tool to open the port and on RHEL 7 you can use Firewalld utility to manage the firewall rules as the below examples:
On Debian based systems
sudo ufw allow 10050/tcp
On RHEL/CENTOS 7 systems
sudo firewall-cmd --add-port=10050/tcp --permanent
For older distributions such as centOS/Rhel 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
Step 5 – Restarting Zabbix Agent
After adding Zabbix server IP in the configuration file, now restart agent service using below command.
sudo service zabbix-agent restart
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
[ram@zabbixserver]$ telnet 10050
Connected to (
Escape character is '^]'.
ZBXD)ZBX_NOTSUPPORTEDInvalid item key format.Connection closed by foreign host

No comments:

Post a Comment