CentOS8에 Zabbix5 설치
데이터베이스 설정
이번에는 데이터베이스로 PostgreSQL v12를 선정했습니다. Zabbix 호환 목록에서 PostgreSQL v9.2.24 이상이면 OK 모양입니다.
설치
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# rpm -Uvh epel-release-latest-8.noarch.rpm
# wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# rpm -Uvh pgdg-redhat-repo-latest.noarch.rpm
# dnf install epel-release
# dnf module disable postgresql
# dnf config-manager --disable pgdg10 pgdg11 pgdg95 pgdg96
# dnf clean all
# dnf install postgresql12-server-12.4-1PGDG.rhel8.x86_64 postgresql12-odbc
초기 설정
# su - postgres
postgres$ vim .bash_profile
.bash_profile
export PGDATA
# 以下を追記
export PATH=$PATH:/usr/pgsql-12/bin
postgres$ source .bash_profile
postgres$ initdb --encoding=utf8 --locale=C -D /var/lib/pgsql/12/data
postgres$ exit
# systemctl start postgresql-12
# systemctl enable postgresql-12
프런트 엔드 설정
Zabbix에서 프런트 엔드를 Nginx로 만들면 Zabbix 설치 중에 동시에 설치되는 모양입니다.
ZabbixServer 설정
설치
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all
# dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-agent zabbix-get vlgothic-fonts vlgothic-p-fonts
# sudo -u postgres createuser --pwprompt zabbix
could not change directory to "/root": 許可がありません ※無視してOK
Enter password for new role: 任意のDBパスワード
Enter it again: 任意のDBパスワードもう一度
# sudo -u postgres createdb -O zabbix zabbix
could not change directory to "/root": 許可がありません ※無視してOK
# zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
...
INSERT 0 1
COMMIT
# cp -p /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.default
# vim /etc/zabbix/zabbix_server.conf
/etc/zabbix/zabbix_server.conf
# DBPassword=
DBPassword=DBパスワード
# cp -p /etc/nginx/conf.d/zabbix.conf /etc/nginx/conf.d/zabbix.conf.default
# vim /etc/nginx/conf.d/zabbix.conf
/etc/nginx/conf.d/zabbix.conf
listen 80;
server_name サーバーのIP サーバのFQDN;
# cp -p /etc/php-fpm.d/zabbix.conf /etc/php-fpm.d/zabbix.conf.default
# echo "php_value[date.timezone] = Asia/Tokyo" >> /etc/php-fpm.d/zabbix.conf
# rm /etc/alternatives/zabbix-web-font
# ln -s /usr/share/fonts/vlgothic/VL-PGothic-Regular.ttf /etc/alternatives/zabbix-web-font
# systemctl restart zabbix-server zabbix-agent nginx php-fpm
# systemctl enable zabbix-server zabbix-agent nginx php-fpm
최초 설정
웹 브라우저에서 다음
URL로 이동하여 초기 설정을 시작합니다.
http://{서버 IP or FQDN}/zabbix.php

시스템 요구 사항 검사는 NG가 없는지 확인합니다.

Password
부분에 DB 암호를 입력합니다. 다른 사람은 만질 필요가 없습니다.



초기 ID는
Admin
이고 암호는 zabbix
입니다.

표시를 일본어로 합니다. 화면 왼쪽 하단의
User settings
를 클릭합니다.
Language
를 Japanese (ja_JP)
로 설정합니다.
일본어 표시가 되었습니다.

설정 튜닝
이대로도 움직이지만 쾌적하게 동작하도록 각종 튜닝을 실시해 둡니다.
PostgreSQL
# mkdir /etc/systemd/system/postgresql-12.service.d
# vim /etc/systemd/system/postgresql-12.service.d/override.conf
/etc/systemd/system/postgresql-12.service.d/override.conf
[Service]
LimitNOFILE=65536
LimitNPROC=65536
# systemctl daemon-reload
# systemctl restart postgresql-12
Nginx
# vim /etc/systemd/system/nginx.service.d/override.conf
/etc/systemd/system/postgresql-12.service.d/override.conf
[Service]
LimitNOFILE=65536
LimitNPROC=65536
# systemctl daemon-reload
# systemctl restart nginx
PHP
# vim /etc/php-fpm.d/zabbix.conf
/etc/php-fpm.d/zabbix.conf
php_value[memory_limit] = 1024MB ※環境に合わせて要調整
# systemctl restart zabbix-server zabbix-agent nginx php-fpm
ZabbixAgent 지원 모니터링 대상 추가
ZabbixAgent를 도입할 수 있는 OS라면, 매우 다방면에 걸친 정보를 취득할 수 있게 됩니다. 꼭 넣어 둡시다.
여기에서는 CentOS8 최소 설치를 대상으로 합니다.
모니터링 대상에 Agent 설치
# wget https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# rpm -Uvh zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all
# dnf install zabbix-agent zabbix-get
# cp -p /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.default
# vim /etc/zabbix/zabbix_agentd.conf
/etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1,ZabbixServerのIPアドレス
#Hostname=Zabbix server ※コメントアウト
# systemctl start zabbix-agent
# systemctl enable zabbix-agent
ZabbixServer에 등록
감시 대상에 Agent를 넣은 것만으로는 ZabbixServer에 등록되지 않습니다. 다음 절차에 따라 등록합니다.
ZabbixWeb 콘솔에 로그인하고 왼쪽 메뉴에서
設定
→ ホスト
를 선택합니다.
호스트 화면의 오른쪽 상단에 있는
ホストの作成
를 클릭합니다.
ホスト名
에 호스트 이름을, グループ
, Linux Servers
, インタフェース
, IPアドレス
에 원하는 IP 주소를 입력하십시오.
新規テンプレートをリンク
에서 Template OS Linux by Zabbix agent
를 적용하고 追加
를 클릭합니다.
추가하고 몇 분 후에 호스트 목록에서 추가한 호스트의
エージェントの状態
를 확인하면 ZBX
가 녹색으로 바뀝니다. 이제 감시 대상이 되었습니다.
참고 페이지
Reference
이 문제에 관하여(CentOS8에 Zabbix5 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/SkyLaptor/items/66275ef14451b546dc3a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)