安装mariadb
$ yum -y install mariadb mariadb-devel mariadb-server # centos7下安装的是mariadb
$ systemctl enable mariadb
$ systemctl start mariadb
设置初始密码
$ mysqladmin -u root -h localhost password 'Ab123456'
创建数据库 zabbix 并授权
$ mysql -uroot -pAb123456
> create database zabbix character set utf8 collate utf8_bin;
> grant all privileges on zabbix.* to zabbix@192.168.153.152 identified by 'zabbix'; 客户机授权
> CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbix';
> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'
> quit
初始化数据库
$ zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix_database_name
修改zabbix_server配置文件
$ vim /etc/zabbix/zabbix_server.conf
DBHost=192.168.153.153
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
修改PHP时区
$ vim /etc/httpd/conf.d/zabbix.conf
将下面这行修改为亚洲上海
php_value date.timezone Asia/Shanghai
配置本机配置zabbix-agent
$ vim /etc/zabbix/zabbix_agentd.conf # 修改agent配置文件
Server=192.168.2.205 # zabbix服务端内网IP
ServerActive=192.168.2.205 # zabbix服务端内网IP,Active表示agent主动推送
Hostname=Jump Server # zabbix客户端主机名称,需要和web端添加的名称一致
Include=/etc/zabbix/zabbix_agentd.d/*.conf