Centos7部署Zabbix

浏览zabbix官网,发现centos7只能部署zabbix5.0版本
https://www.zabbix.com/cn/download?zabbix=5.0&os_distribution=centos&os_version=7&components=server_frontend_agent&db=mysql&ws=apache
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm   #首先更改rpm源
yum -y install zabbix-server-mysql zabbix-agent zabbix-get mariadb mariadb-server centos-release-scl   #安装zabbix
vi /etc/yum.repos.d/zabbix.repo    #编辑[ zabbix-frontend ]下修改enabled=1
systemctl start mariadb    #启动数据库
mysql_secure_installation   #初始化数据库
mysql -uroot -p   #登录数据库并如下配置
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'password';
grant all privileges on zabbix.* to zabbix@localhost;
quit;
yum -y install zabbix-web-mysql-scl zabbix-nginc-conf-scl   #安装前端
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix(库名)   #导入初始数据和架构
vi /etc/zabbix/zabbix_server.conf   #编辑配置文件
DBHost=localhost
DBPassword=之前设置的数据库密码
vi etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf     #编辑nginx配置把listen端口修改为10088或者别的
vi  etc/opt/rh/ rh-php72/php-fpm.d/zabbix.conf   #编辑php,修改以下几条
listen.acl_users=apache,nginx
php_value[date.timezone]=Asia/Shanghai

接下来,启动systemctl start zabbix-server zabbix-agent  rh-nginx116-nginx rh-php72-php-fpm
网页访问地址+端口,按需设置,完成,默认账号Admin密码zabbix

Leave a comment

Your email address will not be published. Required fields are marked *