LOGIN
정보보안학과 실무역량 강화 브릿지 프로그램

2차시 · Zabbix를 활용한 서버 모니터링

감시할 서버에 에이전트를 깔면 상태 정보가 Zabbix 서버로 모이고, 문제가 생기면 알람이 울리는 구조를 직접 구축.

Zabbix 구조 (Zabbix는 APM(Apache + PHP + MySQ) 기반으로 돌아간다)
Zabbix 에이전트: 모니터링하고 싶은 서버마다 설치. MQTT에서 publish하는 쪽처럼 상태를 계속 보냄
Zabbix 서버: 정보를 받아 모으다가 이벤트가 생기면 알람
들어오는 메시지(이벤트)에 맞춰 무슨 일이 일어났는지 알려주는 게 목적

실습 환경 준비
1. VirtualBox에서 도구 → 네트워크 → NAT 네트워크 만들기
2. VM 두 대 생성: ZabbixServer, ZabbixClient
3. Ubuntu 24.04.4 Live Server ISO로 설치, 디스크는 VMDK
4. 설치할 때 SSH 활성화
5. ZabbixServer(10.0.2.15), ZabbixClient(10.0.2.3)
6. 포트포워딩 - 80 (ZabbixClient), 22 (ZabbixServer(호포 : 22015 | 게포 : 22), ZabbixClient(호프 : 22003 | 게프 : 22))
7. xshell 설정 → ipconfig(210.93.15.40) → ZabbixServer(210.93.15.40:22015), ZabbixClient(210.93.15.40:22003)

공동 설정
1. nano /etc/hosts
2. nano /etc/hostname
- 각각 ZabbixServer, ZabbixClient 으로 바꾸어 줌
3. sudo apt install net-tools

ZabbixClient 설치 및 설정
서버월드 : https://www.server-world.info/en/note?os=Ubuntu_24.04&p=zabbix70&f=5
경로 : ubuntu 24.04 LTS → monitoring → add monitoring target (ubuntu)
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb

dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb 
Selecting previously unselected package zabbix-release.
(Reading database ... 123391 files and directories currently installed.)
Preparing to unpack zabbix-release_7.0-1+ubuntu24.04_all.deb ...
Unpacking zabbix-release (1:7.0-1+ubuntu24.04) ...
Setting up zabbix-release (1:7.0-1+ubuntu24.04) ...

apt update
apt -y install zabbix-agent2

nano /etc/zabbix/zabbix_agent2.conf
# line 80 : specify Zabbix server
Server=10.0.2.15
# line 133 : specify Zabbix server
ServerActive=10.0.2.3
# line 144 : change to your hostname
Hostname=node01.srv.world
 
systemctl restart zabbix-agent2
ZabbixServer 설치
서버 월드 : https://www.server-world.info/en/note?os=Ubuntu_24.04&p=zabbix70&f=1
경로 : ubuntu 24.04 LTS → monitoring → install Zabbix 7.0

apt -y install apache2
apt -y install php8.3-fpm
apt -y install mariadb-server
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb\

dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 123391 files and directories currently installed.)
Preparing to unpack zabbix-release_7.0-1+ubuntu24.04_all.deb ...
Unpacking zabbix-release (1:7.0-1+ubuntu24.04) ...
Setting up zabbix-release (1:7.0-1+ubuntu24.04) ...

apt update
apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 php-mysql php-gd php-bcmath php-net-socket

노트 이미지 2
목록