CentOS7安装部署zabbix5.0

关闭防火墙和selinux

systemctl stop firewalld.service
setenforce 0
进入vim /etc/selinux/config
SELINUX=disadled

安装 Zabbix 存储库

Rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all

安装 Zabbix 服务器和代理

yum -y install zabbix-server-mysql zabbix-agent
yum -y install centos-release-scl		(启用红帽软件集合)
vim /etc/yum.repos.d/zabbix.repo		(启用zabbix前端存储库)
[zabbix-frontend]
enabled=1
yum -y install zabbix-web-mysql-scl zabbix-nginx-conf-scl  (安装zabbix前端包)

Mysql数据库安装配置

yum -y install mariadb mariadb-server
systemctl start mariadb		(启动数据库)
mysql		(进入数据库)
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> create user zabbix@localhost identified by 'password';
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
zcat /usr/share/doc/zabbix-server-mysql-5.0.7/create.sql.gz | mysql -uzabbix -pzabbix zabbix	(导入初始框架和数据)

配置zabbix-server文件

vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

配置php文件

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
[zabbix]
user = nginx
group = nginx

php_value[date.timezone] = Asia/Shanghai(设置时区)
vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
listen          80;
server_name     192.168.226.169;

#fastcgi_pass    unix:/var/opt/rh/rh-php72/run/php-fpm/zabbix.sock;
fastcgi_pass    127.0.0.1:9000;

启动zabbix和代理进程

systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm

192.168.226.169/setup.php

配置php环境

vim /etc/opt/rh/rh-php72/php.ini
post_max_size = 16M
max_execution_time = 300(最大执行时间)
max_input_time = 300(最大输入时间)
date.timezone = 'Asia/Shanghai'(设置时区)

重启zabbix和代理进程

systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm

访问zabbix页面

192.168.226.169/setup.php

你可能感兴趣的:(centos,zabbix,mysql)