Zabbix 6.4 설치 - 분리 구성(Ubuntu 22.04.5LTS)

2024. 5. 7. 09:57·모니터링(Zabbix,Grafana)

Zabbix 6.4 에 새로운 기능도 많이 생기고, DB 도 변경(MySQL -> PostgreSQL)할 겸 재설치를 진행.

업그레이드 및 DB 마이그레이션도 가능하지만 기존 장비가 제대로 운영되지 않아 재설치 진행 함.

---------- ---------- ---------- ---------- ----------

  • Zabbix 6.4 새로운기능- https://www.zabbix.com/whats_new_6_4
 

What’s new in Zabbix 6.4

With Zabbix 6.4, managing your Zabbix configuration is easier than ever! Automate your Zabbix user management with Just-in-time LDAP and SAML user provisioning; upgrade to the latest Zabbix release with zero downtime; instantly sync your configuration chan

www.zabbix.com

 

  • PostgreSQL vs MySQL 테스트 참고 - https://assets.zabbix.com/files/zabconf2013/Which_Database_is_Better_for_Zabbix.pdf

---------- ---------- ---------- ---------- ----------

 

 

구성 정보

  • OS: Ubuntu 22.04.4 LTS
  • PostgreSQL: psql (PostgreSQL) 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1)
  • Zabbix Server: zabbix_server (Zabbix) 6.4.14
  • Zabbix Agent: zabbix_agentd (daemon) (Zabbix) 6.4.14
  • Server 구성: zdb(zabbix db) / zweb(zabbix front) / zserver(zabbix server)

---------- ---------- ---------- ---------- ----------

 

 

설치

zserver

# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
# apt install zabbix-server-pgsql zabbix-agent
# systemctl start zabbix-server.service
# systemctl enable zabbix-server.service
# systemctl status zabbix-server.service

 

zweb

# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
# apt install zabbix-frontend-php php8.1-pgsql zabbix-apache-conf zabbix-agent
# systemctl start apache2
# systemctl enable apache2
# systemctl status apache2

 

zdb

# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
# apt install postgresql
# apt install zabbix-sql-scripts zabbix-agent
# systemctl status postgresql
# systemctl enable postgresql

 

zproxy

# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
# apt install postgresql
# apt install zabbix-proxy-pgsql zabbix-sql-scripts zabbix-agent
# systemctl status postgresql
# systemctl enable postgresql

---------- ---------- ---------- ---------- ----------

 

 

설정

zdb

/tmp 아래로 이동 후 진행

(DB 초기화)

# sudo -u postgres createuser --pwprompt zabbix
# sudo -u postgres createdb -O zabbix zabbix

(DB 스키마 생성)

# zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix

(DB 외부 연동 설정)

# vi /etc/postgresql/14/main/postgresql.conf

  • 변경 전: listen_addresses = 'localhost'
  • 변경 후: listen_addresses = '*' 

# vi /etc/postgresql/14/main/pg_hba.conf

IPv4 local connections: 수정

  • 변경 전: host    all             all             127.0.0.1/32            scram-sha-256
  • 변경 후: host    all             all             0.0.0.0/0            scram-sha-256

(DB 권한 설정)

# sudo -u postgres psql

(데이터베이스 목록 확인)

postgres=# \l

 

(권한 부여)

postgres=# GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;

(데이터베이스 목록 확인)

postgres=# \l

(나가기)

postgres=# \q

 

# systemctl restart postgresql

 

zserver

(DB 연동)

# vi /etc/zabbix/zabbix_server.conf

  • DBHost=zdb
  • DBPassword=설정한 패스워드

# systemctl restart zabbix-server.service

 

zweb

(설정 파일 복사)

# cp /usr/share/zabbix/conf/zabbix.conf.php.example /etc/zabbix/web/

# cd /etc/zabbix/web/

# mv zabbix.conf.php.example zabbix.conf.php

(DB 및 Sever 연동) 

# vi /etc/zabbix/web/zabbix.conf.php

  • $DB['TYPE']                             = 'POSTGRESQL';
  • $DB['SERVER']                   = 'zdb';
  • $DB['PORT']                             = '5432';
  • $DB['PASSWORD']                 = ' 설정한 패스워드 ';
  • $ZBX_SERVER_NAME                = 'zserver';

# systemctl restart apache2

 

zproxy

/tmp 아래로 이동 후 진행

(DB 초기화)

# sudo -u postgres createuser --pwprompt zabbix
# sudo -u postgres createdb -O zabbix zabbix_proxy

(DB 스키마 생성)

# cat /usr/share/zabbix-sql-scripts/postgresql/proxy.sql | sudo -u zabbix psql zabbix_proxy

(Proxy 설정)

# vi /etc/zabbix/zabbix_proxy.conf

  • Server=zserver
  • ProxyMode=0
  • Hostname=zproxy
  • DBPassword= 설정한 패스워드
  • DataSenderFrequency=60

# systemctl restart zabbix-proxy

# systemctl enable zabbix-proxy

---------- ---------- ---------- ---------- ----------

 

 

확인

(웹 접속)

http://zweb/zabbix

  • 초기 id/비번: Admin/zabbix    (대소문자 구분)

---------- ---------- ---------- ---------- ----------

 

 

Proxy 서버 등록

웹 접속 후 Administration - Proxies 클릭

오른쪽 상단 Create proxy 클릭 -> 입력 후 Add

 

등록 후

일정 시간 경과 후 데이터 전송

---------- ---------- ---------- ---------- ----------

 

 

참고

apache2 실행 오류

May 03 06:39:09 zweb systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
May 03 06:39:09 zweb systemd[1]: apache2.service: Failed with result 'exit-code'.
May 03 06:39:09 zweb systemd[1]: Failed to start The Apache HTTP Server.

 

구동 중인 nginx 중지 후 apache2 재실행

# netstat -nlp | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      710/nginx: master p
tcp6       0      0 :::80                   :::*                    LISTEN      710/nginx: master p
# kill -9 710

 

 

System Infomation 경고창

zserver에서 zabbix_server.conf 파일안에  NodeAddress=localhost:10051 부분을 수정

# vi /etc/zabbix/zabbix_server.conf

  • 변경 전: NodeAddress=localhost:10051
  • 변경 후: NodeAddress=zserver:10051

# systemctl restart zabbix-server.service

저작자표시 비영리 변경금지 (새창열림)
'모니터링(Zabbix,Grafana)' 카테고리의 다른 글
  • zabbix 마이너 버전 업그레이드 (6.4.14 -> 6.4.18)
  • zabbix 그래프 끊김
  • Zabbix proxy 서비스 시작 실패(One child process died) - out of memory
  • Zabbix value cache working in low memory mode
기억보다는 기록을...
기억보다는 기록을...
내가 보려고 정리하는 글..
  • 기억보다는 기록을...
    메모장
    기억보다는 기록을...
    • 분류 전체보기
      • 클라우드(Azure, AWS, Alibaba)
      • 모니터링(Zabbix,Grafana)
      • 가상화(VMWare, Hyper-V)
      • Docker
      • Ansible
      • Linux
      • Windows
      • 이것저것
      • SQL
      • -------------------------
      • 재테크
  • 전체
    오늘
    어제
  • hELLO· Designed By정상우.v4.10.2
기억보다는 기록을...
Zabbix 6.4 설치 - 분리 구성(Ubuntu 22.04.5LTS)
상단으로

티스토리툴바