系统:CentOS Linux release 7.4.1708 (Core)
zabbix版本:Zabbix 3.4.1. © 2001–2017, Zabbix SIA
1、关闭selinux、防火墙
1 2 3 4 5 6 |
vim /etc/selinux/config SELINUX=disabled setenforce 0 systemctl stop firewalld.service systemctl disable firewalld.service |
官方文档:https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos
1 2 |
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm yum install -y zabbix-server-mysql zabbix-web-mysql |
2、创建数据库
CentOS 7.x上MySQL数据库叫mariadb,需要安装以下包
1 |
yum install -y mariadb mariadb-server |
1 2 |
systemctl start mariadb systemctl enable mariadb.service |
1 2 3 4 5 |
mysql -uroot -p #初始无密码,回车进入数据库 create database zabbix character set utf8 collate utf8_bin; #创建数据库及utf8编码 grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; #密码:zabbix flush privileges; #刷新 exit #退出 |

初始化数据库
1 |
zcat /usr/share/doc/zabbix-server-mysql-3.4.1/create.sql.gz | mysql -uzabbix -p zabbix #回车输入密码 zabbix,稍等片刻即完成。 |
use zabbix;
show tables;
3、配置Zabbix Server 数据库
1 2 |
vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix |
1 2 |
systemctl start zabbix-server systemctl enable zabbix-server |
4、zabbix agent 安装及启动
1 2 3 |
yum install -y zabbix-agent systemctl start zabbix-agent systemctl enable zabbix-agent |
5、PHP配置
1 |
vim /etc/httpd/conf.d/zabbix.conf |

启动并设置开机启动
1 2 |
systemctl start httpd systemctl enable httpd |
6、开始安装
先重启下所有服务
1 2 3 4 |
systemctl restart mariadb systemctl restart zabbix-server systemctl restart zabbix-agent systemctl restart httpd |
浏览器访问,中途只有一次输入数据库密码,一路下一步直到完成。
1 |
http://IP地址/zabbix/setup.php |






登录界面
