Network & Server Factory

개인 공부 기록

Server & OS/Monitoring

[ZABBIX] Linux에 Zabbix Agent 5.4 설치

1nfra 2022. 10. 8. 20:09

CentOS 7(RHEL 7 계열) 서버에 Zabbix Agent 5.4를 rpm으로 설치하고, zabbix_agentd.conf에 서버 정보를 넣은 뒤 10050/tcp 포트를 열었습니다. Windows 10 Agent 설치에 이어지는 글입니다.

1. 환경

항목 값
Agent 설치 서버 CentOS 7 (192.168.232.129)
Zabbix 서버 192.168.232.128
Agent 버전 5.4.0
포트 10050/tcp

2. 설치 과정

2.1 Agent 패키지 설치

Zabbix 공식 저장소에서 OS 버전에 맞는 Agent 패키지를 찾아 rpm으로 설치합니다.

 

Zabbix Official Repository

 

repo.zabbix.com

[root@Linux_master ~]# rpm -ivh http://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-agent-5.4.0-8.el7.x86_64.rpm
Retrieving http://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-agent-5.4.0-8.el7.x86_64.rpm
warning: /var/tmp/rpm-tmp.6J9dLZ: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY                                  
Preparing...                          ################################# [100%]                                            
Updating / installing...                                                                                                  
   1:zabbix-agent-5.4.0-8.el7         ################################# [100%]

2.2 zabbix_agentd.conf 설정

  • Server: Zabbix 서버의 IP 또는 호스트 이름
  • ServerActive: 이 글에서는 쓰지 않아 주석 처리
  • Hostname: Agent를 설치한 서버의 IP 또는 호스트 이름 (Zabbix에 등록할 호스트 이름과 같아야 함)
[root@Linux_master ~]# vi /etc/zabbix/zabbix_agentd.conf


119 Server=192.168.232.128         [Zabbix Server의 IP 또는 호스트 이름]
160 #ServerActive=127.0.0.1        [주석 처리]
171 Hostname=192.168.232.129       [Agent 설치 서버의 IP 또는 호스트 이름]

2.3 서비스 시작과 방화벽

Agent를 시작하고 부팅 시 자동 실행되도록 등록한 뒤, 10050/tcp 포트를 엽니다.

[root@Linux_master ~]# systemctl start zabbix-agent                                                                       
[root@Linux_master ~]# systemctl enable zabbix-agent                                                                      
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-ag
ent.service.                                                                                                              
[root@Linux_master ~]# firewall-cmd --permanent --zone=public --add-port=10050/tcp                                        
success                                                                                                                   
[root@Linux_master ~]# firewall-cmd --reload                                                                              
success                                                                                                                   
[root@Linux_master ~]# firewall-cmd --list-ports                                                                          
4200/tcp 10050/tcp                                                                                                        
[root@Linux_master ~]#

3. 정리

  • Agent는 OS 버전에 맞는 패키지를 공식 저장소에서 받아 설치합니다.
  • zabbix_agentd.conf의 Server에는 Zabbix 서버를, Hostname에는 Agent 서버를 적습니다.
  • Zabbix 서버가 Agent에 접속할 수 있도록 10050/tcp를 열어야 합니다.
728x90
서울
--:--:--
-전체 글
-카테고리
오늘 방문