Deploy Zabbix Agent into CentOS and Add into Zabbix Server - NETSEC

Latest

Learning, Sharing, Creating

Cybersecurity Memo

Thursday, March 12, 2020

Deploy Zabbix Agent into CentOS and Add into Zabbix Server

Zabbix Agent is required to install on all remote systems needs to be monitor through Zabbix server. The Zabbix Agent collects resource utilization data and applications data on the client system and provides such information to the Zabbix server on their requests.

There are two types of checks between Zabbix Server and Client.
  • Passive Check – Zabbix Agent sent data to server on their request.
  • Active Check – Zabbix Agent sends data periodically to server.



In this lab post, we are focusing on Active Check type. Here is the diagram we are talking about






Notes:
1. for passive items, zabbix server must be able to connect on port 10050 on agent ip, as configured in the host properties;
2. for active items, zabbix agents must be able to connect to the zabbix server on port 10051 and their Hostname directive in their config file must match host name on the zabbix server (not ip, not dns - host name). (Including upper/lower case letters)
3. If you make changes in the agent conf file, you must restart the agent.

1. Install Zabbix Agent 4.0

Before installing Zabbix Agent first configure Zabbix yum repository using following commands as per your required version and operating system.
CentOS/RHEL 7:
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

CentOS/RHEL 6:
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-2.el6.noarch.rpm

yum -y install zabbix-agent

2. Zabbix Agent Configuration


vim /etc/zabbix/zabbix_agentd.conf
Server=34.67.224.10
ServerActive=34.67.224.10
Hostname=CentOS1
Start Zabbix-Agent service:
systemctl enable zabbix-agent.service systemctl start zabbix-agent.service



3. Add Linux host into Zabbix Web GUI

3.1 Create host group
You can create your own group to accommodate your linux servers. It is at Configuration -> Host groups -> Create host group.

3.2 Create a new template 
From Configuration -> Templates ->Create template button, you can create your own template if it is needed. Make sure it has been linked it to existing template to have all items.

3.3 Create a host and link it to the group and template



Note: Please make sure the interface ip is 127.0.0.1 and port number is 10050.
Search your new created template and add it into Linked templates.


4. Verification

From Agent machine:
yum -y install telnet
telnet 34.67.221.10 10051


YouTube Video:





No comments:

Post a Comment