准备环境
OS centos7.4
Zabbix version:3.4.2
Database:MariaDB
安装数据库
yum -y install mariadb-server
systemctl start mariadb && systemctl enable mariadb
安装zabbix的yum源
rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
安装zabbix服务器.前端,代理
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
创建zabbix数据库
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all on zabbix.* to zabbix@'172.20.29.%' identified by 'rilegou';
mysql> flush privileges;
mysql> quit;
导入zabbix表结构
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -h 172.20.29.209 -p zabbix
修改zabbix配置文件
#查看修改的配置文件
grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
vim /etc/zabbix/zabbix_server.conf
DBHost= #添加数据库主机地址
DBPassword= #添加数据库用户密码
为Zabbix前端配置PHP,更改时区
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai #修改时区
开启服务
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
转载于:https://blog.51cto.com/13769014/2148068