2025年1月16日 星期四

網管軟體 Zabbix

Reference:
監控大挑戰 – 以 Zabbix 為例 Day 05. 安裝 Zabbix Server
 
安裝步驟:
install RockyLinux 9 (minimal install)
dnf update
dnf install -y epel*
 
#到Zabbix網站選擇安裝方式

vi /etc/yum.repos.d/epel.repo
[epel]
...
excludepkgs=zabbix*

rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
dnf clean all

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
dnf install mysql-server
systemctl start mysqld
#剛裝好沒有密碼,登入修改
mysql -uroot
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';

mysql -uroot -p

#Create initial database
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'NewPassword';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;

#輸入密碼,等待匯入資料庫
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

#Disable log_bin_trust_function_creators option after importing database schema
mysql -uroot -p
set global log_bin_trust_function_creators = 0;
quit;
vi /etc/zabbix/zabbix_server.conf
DBPassword=NewPassword

systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm

vi /etc/nginx/conf.d/zabbix.conf
listen 8080;

systemctl restart nginx

firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

#設定zabbix
http://192.168.12.3:8080/

預設帳號密碼 Admin / zabbix




沒有留言:

張貼留言