1. 程式人生 > 其它 >centOS7.6安裝zabbix5.0--2022

centOS7.6安裝zabbix5.0--2022

前期準備工作就不演示了,關閉防火牆,selinux

我選擇的是apache ,不是nginx安裝

1,配置源

# rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

2,替換

# sed -i 'http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo

3,安裝

# yum install zabbix-server-mysql zabbix-agent -y

4,安裝scl

# yum install centos-release-scl -y

5,編輯前端配置檔案

# /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

[zabbix-frontend]
...
enabled=1 (0改為1)
...

6,安裝前端環境

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

7,安裝資料庫,並啟動

# yum install mariadb-server -y

# systemctl enable --now mariadb

8,配置資料庫

# mysql_secure_installation

下面會有提示設定密碼,再然後按 y,n n n y 完事

登入資料庫

#mysql -uroot -p

輸入密碼

9,建立zabbix資料庫

MariaDB [(none)]>create database zabbix character set utf8 collate utf8_bin;

10,建立zabbix使用者

MariaDB [(none)]> create user zabbix@localhost identified by 'passwd';

11,授權

MariaDB [(none)]> grant all on zabbix.* to zabbix@localhost identified by 'zabbix';

MariaDB [(none)]> flush privileges;

12,匯入資料庫資訊

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

輸入密碼:passwd

13,修改zabbixserver配置檔案

# vim /etc/zabbix/zabbix_server.conf

DBPassword=passwd

14,修改zabbix php配置檔案,配置時區

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/Shanghai

15,啟動相關zabbix服務

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

16,頁面訪問

IP/zabbix 就可以看到頁面配置啦

到這裡基本搭建就完事了

—————————————————————————————我也是有底線的———————————————————————————————————————————