1,配置IP地址、主机名,关闭 kdump 与 SELinux
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@localhost ~]# vim /etc/sysconfig/network
[root@localhost ~]# vim /etc/hosts
[root@localhost ~]# vim /etc/selinux/config
[root@localhost ~]# systemctl stop kdump
[root@localhost ~]# systemctl disable kdump
[root@localhost ~]# reboot
2,安装Apache 和 Mariadb
[root@zbx ~]# yum install httpd -y
[root@zbx ~]# yum install mariadb-server -y
[root@zbx ~]# systemctl start httpd.service
[root@zbx ~]# systemctl enable httpd.service
[root@zbx ~]# systemctl start mariadb.service
[root@zbx ~]# systemctl enable mariadb.service
3,安装PHP
[root@zbx ~]# yum -y install php
4,安装PHP组件,使PHP支持 MariaDB
[root@zbx ~]# yum -y install php-mysql php-gd libjpeg* php-ldap php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
5,重启MariaDB、 Apache
[root@zbx ~]# systemctl restart mariadb.service
[root@zbx ~]# systemctl restart httpd.service
6,安装“Zabbix安装包”资源存储库
[root@zbx ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
7,安装Zabbix
[root@zbx ~]# yum install centos-release-scl -y
8,对数据库进行初始化并创建Zabbix数据库
[root@zbx ~]# mysqladmin -u root password 9865321
[root@zbx ~]# mysql -uroot -p
9,编辑Zabbix数据库配置文件并启动Zabbix服务
[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf
[root@zbx ~]# systemctl start zabbix-server
[root@zbx ~]# systemctl enable zabbix-server
10,修改 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
[root@zbx ~]# vim /etc/httpd/conf.d/zabbix.conf
11,配置防火墙
[root@zbx ~]# systemctl stop firewalld.service
启动 Zabbix server and agent
[root@zbx ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@zbx ~]# systemctl enable zabbix-server zabbix-agent httpd
12,Linux Agent的安装与配置
[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@localhost ~]# yum -y install zabbix-agent
[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf
[root@localhost ~]# chkconfig zabbix-agent on
[root@localhost ~]# systemctl restart zabbix-agent.service
[root@localhost ~]# iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
[root@localhost ~]# systemctl stop firewalld.service
13,在服务端添加主机