官方安装文档地址:
https://www.zabbix.com/download?zabbix=5.0&os_distribution=centos&os_version=8&db=mysql&ws=nginx
1安装前配置:
//关闭防火墙:
systemctl stop firewalld
systemctl disable firewalld
//关闭selinux
getenforce
setenforce 0
sed -i "/^SELINUX/s/enforcing/disabled/" /etc/selinux/config
getenforce
//安装epel
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
//安装mysql
dnf -y install wget
yum -y install https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm
yum install mysql-server -y
systemctl start mysqld && systemctl status mysqld
systemctl enable mysqld
mysql -uroot -p(直接回车,登录无密码)
mysql> alter user ‘root‘@‘localhost‘ identified by ‘123456‘;
安装zabbix:
a. 安装Zabbix存储库
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
dnf clean all
b. Install Zabbix server, frontend, agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent
c. Create initial database
[root@mobanji ~]#mysql -uroot -p123456
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by ‘123456‘;
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit
在Zabbix服务器主机上导入初始架构和数据:
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p123456 zabbix
d为Zabbix服务器配置数据库:
vim /etc/zabbix/zabbix_server.conf
DBPassword=123456
e为Zabbix前端配置PHP:
vim /etc/nginx/conf.d/zabbix.conf
listen 80;
server_name 10.0.0.200;
设置时区:
vim /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
f启动Zabbix服务器和代理进程
systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm
g浏览器访问ip并进行配置
户用名:Admin
密码:zabbix