Zabbix Server通过Agent传来的数据写入数据库(MySQL),最终通过PHP+Apache在Web界面进行前端展示
所以在启动Zabbix之前需要搭建LAMP环境
1、环境搭建
- 关闭SELinux和防火墙
临时关闭
setenforce 0 #关闭SELinux
systemctl stop firewalld.service #关闭防火墙
永久关闭
vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled #关闭SELinux
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
systemctl disable firewalld.service #开机不启动
2. 安装httpd、Mysql(Mariadb)服务和PHP环境
[root@master ~]# yum -y install httpd mariadb mariadb-server php php-mysql
[root@master ~]# rpm -qa httpd php mariadb #查看安装版本
mariadb-5.5.68-1.el7.x86_64
php-5.4.16-48.el7.x86_64
httpd-2.4.6-97.el7.centos.4.x86_64
[root@master ~]# systemctl start mariadb httpd #启动服务
[root@master ~]# systemctl enable mariadb httpd #开机启动
3. 安装Zabbix依赖软件及组件
[root@master ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm #下载Zabbix软件源
[root@master ~]# yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender #安装zabbix需要的组件
4. 创建zabbix需要的数据库
mysql #进入数据库 create