zabbix服务端基本配置

准备阶段

关闭防火墙

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

systemctl disable --now firewalld

reboot

 

更新zabbix源

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

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

yum clean all

yum makecache

 

安装阶段

安装zabbix前置组件

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

yum install centos-release-scl -y

 

编辑zabbix.repo

vim /etc/yum.repos.d/zabbix.repo

[zabbix-frontend]

enabled=1 # 修改这⾥

 

安装zabbix组件

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

yum install mariadb-server -y

 

配置阶段

启动DB

systemctl enable --now mariadb

#Created symlink from /etc/systemd/system/multiuser.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

DB配置向导

说白了就是挨个刷一遍,别问为什么,问就是你不刷数据库就建不成

mysql_secure_installation

create database zabbix character set utf8 collate utf8_bin;

create user zabbix@localhost identified by 'XXXXXX'; #创建数据库账户及密码

grant all privileges on zabbix.* to zabbix@localhost;

flush privileges;

quit;

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

zabbix_server.conf配置

vim /etc/zabbix/zabbix_server.conf

DBPassword=XXXXXX #你的数据库密码

zabbix_server.conf验证

grep '^DBPassword' /etc/zabbix/zabbix_server.conf

zabbix.conf配置

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

; php_value[date.timezone] = Asia/Shanghai

zabbix.conf验证

grep 'timezone' /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

保证zabbix及组件开机自启

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

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

THE END