Centos7部署Zabbix3.2

发表日期:2017年12月3日 10:20

环境准备

[root@master ~]# setenforce 0
[root@master ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@master ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@master ~]# yum install epel-release.noarch wget vim gcc gcc-c++ lsof chrony tree nmap unzip rsync -y
[root@master ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

LAMP环境配置

[root@master ~]# yum install httpd mariadb mariadb-server mariadb-client php php-mysql

安装Zabbix服务

[root@master ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
[root@master ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
[root@master ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent

数据库配置

[root@master ~]# mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
MariaDB [(none)]> quit

导入数据

[root@master ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.4/
[root@master zabbix-server-mysql-3.2.4]# zcat create.sql.gz | mysql -uroot -p zabbix
[root@master zabbix-server-mysql-3.2.4]# cd

修改配置

[root@master ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
[root@master ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Chongqing

启动

[root@master ~]# systemctl start httpd
[root@master ~]# systemctl start zabbix-server
[root@master ~]# systemctl start zabbix-agent
# 配置中重写了访问路径
[root@master ~]# vim /etc/httpd/conf.d/zabbix.conf
Alias /zabbix /usr/share/zabbix