Monitoring/Zabbix

[ZABBIX] Zabbix 7.0 Install Ubuntu 22.04 #2

coxfactor-Tech 2024. 9. 5. 17:54

Ubuntu 22.04 Azure VM에 Zabbix 를 설치하는 과정 입니다. 

 

# 시스템 업데이트 및 패키지 설치
sudo apt update && sudo apt -y upgrade
sudo apt -y install apt-transport-https lsb-release ca-certificates

 

# Zabbix 7.0 저장소 추가 및 업데이트 
wget https://repo.zabbix.com/zabbix/7.0/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_7.0-2+ubuntu22.04_all.deb
sudo apt update

 

# Zabbix Server, PHP, Apache, Agent 설치
sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

 

# mysql에 로그인 
sudo mysql -u root

 

# Zabbix DB 및 User 생성 

-- Zabbix 데이터베이스 생성
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

-- Zabbix 사용자 생성
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'passwordtest';

-- 데이터베이스에 대한 권한 부여
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';

-- 함수 생성자에 대한 바이너리 로그 신뢰 설정
SET GLOBAL log_bin_trust_function_creators = 1;

-- 세션 종료
EXIT;

 

# Zabbix DB 스키마 가져오기 
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

* Password 입력 후 조금 기다려~

 

# 바이너리 로그 신뢰 설정 해제

-- MariaDB에 root 사용자로 로그인
sudo mysql -u root

-- 함수 생성자에 대한 바이너리 로그 신뢰 해제
SET GLOBAL log_bin_trust_function_creators = 0;

-- MariaDB 세션 종료
EXIT;

 

# Zabbix 서버 설정

sudo nano /etc/zabbix/zabbix_server.conf

DBUser=zabbix
DBPassword=passwordtest

 

# 서비스 활성화 / 재시작 / 상태 확인

sudo systemctl enable zabbix-server zabbix-agent apache2

sudo systemctl restart zabbix-server zabbix-agent apache2

sudo systemctl status zabbix-server zabbix-agent apache2

 

 

 

다음 초기 설정 ~