**
Initial configuration of Zabbix host
**
Network Card
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32
[root@localhost ~]# vim /etc/hostname
zbx.sevenwin.org
[root@localhost ~]# vim /etc/hosts
10.0.0.12 zbx zbx.sevenwin.org
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
**
Deploy LAMP
**
Install Apache and mariadb
[root@zbx ~]# yum -y install httpd
[root@zbx ~]# yum -y install mariadb-server
[root@zbx ~]# systemctl start httpd.service
[root@zbx ~]# systemctl enable httpd.service
[root@zbx ~]# systemctl start mariadb.service
[root@zbx ~]# systemctl enable mariadb.service
Deploy LAMP
install PHP
[root@zbx ~]# yum -y install php
Install PHP components to make PHP support MariaDB
[root@zbx ~]# yum -y install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
Restart MariaDB, Apache
[root@zbx ~]# systemctl restart mariadb.service
[root@zbx ~]# systemctl restart httpd.service
Deploy zabbix
Install the "Zabbix installation package" resource repository
[root@zbx ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
Install Zabbix
[root@zbx ~]# yum install -y zabbix-server-mysql zabbix-agent zabbix-web-mysql
[root@zbx ~]# yum install centos-release-scl -y
Initialize the database and create the Zabbix database
[root@zbx ~]# mysqladmin -u root password 9865321
[root@zbx ~]# mysql -uroot -p
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'Z9865321';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit
[root@zbx ~]# zcat /usr/share/doc/zabbix-server-mysql-*/create.sql.gz | mysql -uroot zabbix -p
Edit the Zabbix database configuration file and start the Zabbix service
[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost //第81行
DBName=zabbix //第91行
DBUser=zabbix //第107行
DBPassword=Z9865321 //第115行
[root@zbx ~]# systemctl start zabbix-server
[root@zbx ~]# systemctl enable zabbix-server
Modify /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
Configure firewall
[root@zbx ~]# firewall-cmd --permanent --zone=public --add-port=10051/tcp
[root@zbx ~]# firewall-cmd --zone=public --add-port=10051/tcp
[root@zbx ~]# firewall-cmd --permanent --zone=public --add-port=80/tcp
[root@zbx ~]# firewall-cmd --zone=public --add-port=80/tcp
Start Zabbix server and agent
[root@zbx ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@zbx ~]# systemctl enable zabbix-server zabbix-agent httpd
Continue installation in WebUI
[root@zbx ~]# firefox http://127.0.0.1/zabbix
Check the prerequisites.
Configure the database connection.
Configure the server details.
Summary of the pre-installation. The
installation is complete
. Log in to the
WebUI main interface in the WebUI.
Click "Personal Configuration" in the upper right corner to change the language to Chinese
Monitored end (Agent) configuration
Installation and configuration of 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
Server=10.0.0.12 //第95行
ServerActive=10.0.0.12 //第136行
[root@localhost ~]# chkconfig zabbix-agent on
[root@localhost ~]# service zabbix-agent restart
[root@localhost ~]# iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
[root@localhost ~]# systemctl stop firewalld.service
Add a host to add a service on the server side
, for example: MySQL