1.安装后端
1.配置yum源
依照官网安装yum源
rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
如果速度慢,将地址改为阿里镜像源
vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
安装针对于mysql的服务端
yum install -y zabbix-server-mysql
2.安装mysql
yum install -y mariadb-server
systemctl enable --now mariadb.service
3.配置mysql
mysql
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user 'zabbix'@'localhost' identified by 'westos';
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost';
4.使用 MySQL 来导入 Zabbix server 的初始数据库 schema 和数据
cd /usr/share/doc/zabbix-server-mysql-4.0.27/
zcat /usr/share/doc/zabbix-server-mysql-4.0.27/create.sql.gz | mysql -uzabbix -pwestos zabbix
5.为 ZABBIX SERVER/PROXY 配置数据库
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=westos
6.启动 ZABBIX SERVER 进程
systemctl enable --now zabbix-server
7.安装 AGENT
yum install -y zabbix-agent
systemctl enable --now zabbix-agent.service #启动zabbix-agent
2.安装前端
1.在镜像站上下载两个依赖性文件
php-bcmath-5.4.16-46.el7.x86_64.rpm
php-mbstring-5.4.16-46.el7.x86_64.rpm
注:此处需要注意版本号
yum list php
2.安装前端文件
yum install -y zabbix-web-mysql php-bcmath-5.4.16-46.el7.x86_64.rpm php-mbstring-5.4.16-46.el7.x86_64.rpm
3.配置前端
更改时区:
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
启动apache
systemctl enable --now httpd
4.浏览器访问http://172.25.119.1/zabbix