zabbix5.0搭建

一、关闭防火墙:
systemctl stop firewalld.service #停止firewalld服务
systemctl disable firewalld.service #设置开机默认不启动
二、关闭selinux
getenforce #查看状态
vim /etc/sysconfig/selinux #开机不启动
SELINUX=disabled
生产环境单独在防火墙上开启端口和策略

三、安装zabbix5.0源
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
yum clean all *清理yum缓存
四、安装zabbix5.0服务端和客户端
yum install zabbix-server-mysql zabbix-agent #国外源安装可能比较慢或者出错,多试几次
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl zabbix-server zabbix-agent httpd rh-php72-php-fpm -y
五、安装CentOS SCLo RH存储库:
yum install centos-release-scl
编辑配置文件 /etc/yum.repos.d/zabbix.repo

image.png
六、配置数据库
1.安装MariaDB
yum install -y mariadb-server # yum安装MariaDB
systemctl start mariadb.service #启动mariadb
systemctl enable mariadb.service #设置开机启动
mysqladmin -uroot password '********'; #创建管理员密码 自己更改
2.创建初始数据库
mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.
to zabbix@localhost;
mysql> quit;
3.导入初始架构和数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
提示输入的密码为:password
mysql> create user zabbix@localhost identified by 'password';

4.Zabbix server配置数据库
vim /etc/zabbix/zabbix_server.conf
image.png
七、配置PHP
yinstall httpd php php-gd php-ldap php-mysqlnd php-json php-bcmath php-mbstring php-xml mysql mysql-server mysql-devel libevent-devel pcre-devel gcc gcc-c++ make libcurl-devel curl-* net-snmp* libxml2-* wget tar -y

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/Shanghai

image.png
八、启动Zabbix5.0

systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

九、修改字体

在C:WindowsFonts目录下cp任意一个字体
上传到/usr/share/zabbix/assets/fonts下面
修改/usr/share/zabbix/include/defines.inc.php

作者:apple524
链接:https://www.jianshu.com/p/ae562f2c45f9
来源:简书

******************************人因为有理想、梦想而变得伟大,而真正伟大就是不断努力实现理想、梦想*****************************
原文地址:https://www.cnblogs.com/cloudLi/p/13489129.html