No. afka blog No. afka blog

Forrest ACA
Yearning for freedom and hard life~

ZABBIX | install | deploy | cluster

Experimental environment: 1

System: cnetos 7 2 core 4G

Platform: vagrant + LNMP


 Server:, install and configure LNMP and ZABBIX server service 
 server:, install ZABBIX agent to monitor the server


1. Turn off the firewall and turn off the boot

 # systemctl stop firewalld.service
# systemctl disable firewalld.service

2. Turn off SELinux security mechanism

(1) Temporary closure

 # setenforce 0

(2) Permanent closure

 #VIM / etc / SELinux / config 
 set SELinux = enforcing to SELinux = disabled

3. Install LNMP environment

 wget -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && LNMP_ Auto="y" DBSelect="3" DB_ Root_ Password="vagrant" InstallInnodb="y" PHPSelect="5" SelectMalloc="1" ./ lnmp

It is generated by unattended tools on the LNMP official website, specifically as follows:

 MySQL 5.6 php5.6 database root password: vagrant

4. Install ZABBIX server

(1) Install repository configuration package

 rpm -Uvh 64/zabbix-release-4.0-2.el7.noarch.rpm

(2) Install ZABBIX server, web front end and agent

 yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

(3) Create initial database

 #Log in to MySQL database_ Log in to MySQL password;

(4) The initial password and the system will prompt you to enter the new schema.

 # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Execute the following instructions in the current directory for data import. It may take a long time. Please wait patiently

(5) Configure database for ZABBIX server

 Enter / etc / bbix_ Edit the file and modify the following items: 
 dbhost = / / database host 
 dbname = ZABBIX / / database name 
 dbuser = ZABBIX / / user name of database 
 dbpassword = vagrant / / password of logging in database 
 listenip =

(6) Configure the PHP configuration of ZABBIX front end and modify the time zone

 1. Enter the file 
 VIM / etc / httpd / conf.d/zabbix.conf 
 2. Modify the time zone 
 PHP_ value date.timezone Asia/Shanghai

(7) Start ZABBIX server service and httpd service

 Start zabbix-server ා start zabbix-server ා start zabbix-server \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\enablehttpd ා sets the httpd boot service

(8) Web installation of ZABBIX

 Reference address: frontend

Install and configure the ZABBIX agent service on another server

(9) Install ZABBIX agent

 rpm -ivh 64/zabbix-agent-4.0.9-3.el7.x86_ 64.rpm

yum install zabbix-agent

(10) Configure ZABBIX agent service

 1. Enter the file 
 VIM / etc / ZABBIX / ZABBIX_ Modify the following 
 server = / / ZABBIX server host 
 serveractive = / / ZABBIX agent host 
 hostname = / / ZABBIX agent host name

(11) Start the ZABBIX agent service

 Systemctl start ZABBIX agent / / start the service 
 systemctl status ZABBIX agent / / view the status

(12) In the ZABBIX web page, add the configured ZABBIX agent to the host

 Configuration > host > create host: fill in host
This article is written by fufoulka. The address is:

use Knowledge sharing signature 3.0 International license agreement. Except for the reprint / source, they are all original or translated by our website. Please sign before reprinting.

Comment: Grab the sofa

    Nickname (required)
  • Email address (required)
  • website