1、安装zabbix阿里仓库 rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

sed -i 's@repo.zabbix.com@mirrors.aliyun.com/zabbix@g' /etc/yum.repos.d/zabbix.repo

yum clean all

yum makecache

2、安装Zabbix服务器,前端,代理 yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

3、安装mariadb yum install -y mariadb mariadb-server mariadb-devel systemctl start mariadb systemctl enable mariadb

4、初始化数据库 mysql_secure_installation 创建初始数据库 mysql -uroot -p

create database zabbix character set utf8 collate utf8_bin; create user zabbix@localhost identified by 'zabbix'; grant all privileges on zabbix.* to zabbix@localhost; flush privileges; quit

5、在Zabbix服务器主机上,导入初始架构和数据。系统将提示您输入新创建的密码 。 zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

6、编辑文件/etc/httpd/conf.d/zabbix.conf,取消注释并为您设置正确的时区 php_value date.timezone Asia/Shanghai 7、为Zabbix服务器配置数据库编辑文件/etc/zabbix/zabbix_server.conf DBPassword=zabbix 8、 启动Zabbix服务器和代理进程,并使其在系统启动时启动。 systemctl restart zabbix-server zabbix-agent httpd systemctl enable zabbix-server zabbix-agent httpd setenforce 0 systemctl stop firewalld 9、连接到新安装的Zabbix前端:http:// server_ip_or_name/zabbix 账号:Admin 密码:zabbix