2020/09/20

CentOS 7.8 Install Zabbix LTS 5.0.1

最近要幫公司導入Alert Service
目前考慮用Zabbix或Nagios,先嘗試架設看看
前者較肥不過部分協定以及初始時功能較為齊全,相對肥大
後者則是輕量化且警示功能較為強悍,不過需要部份協定或設定時較為麻煩,相對輕盈

安裝代碼如下:
 
# Install Zabbix repo
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all

# Install Zabbix server / agent and frontend
yum install -y zabbix-server-mysql zabbix-agent centos-release-scl

# Eanble Zabbix frontend
vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
enabled=1

yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl

# Create initial database
mysql -u root -p
create database DB_Name character set utf8 collate utf8_bin;
create user USER_NAME@localhost identified by 'password';
grant all privileges on DB_Name.* to USER_NAME@localhost;
quit;

# Inital
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u USER_NAME -p password

# Configure Zabbix server
vim /etc/zabbix/zabbix_server.conf
DBName=DB_Name
DBUser=USER_NAME
DBPassword=password

# Set timezone for Zabbix frontend
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Taipei

# Start Zabbix
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

 

啟動後可以輸入ip or 設定好的domain去連接看看,會看到下方的畫面就開始進行部分初始化


預設帳號為Admin密碼則是zabbix