CentOS7.3 64 bit, build Zabbix3.4

One, system environment



  1. [ root@ecs-5c78-0001 ~]# cat /etc/redhat-release
  2. CentOS Linux release 7.3.1611 (Core)

In order to facilitate testing, stop and start the firewall without starting the firewall, and adjust the production environment as needed



  1. [ root@ecs-5c78-0001 ~]# systemctl stop firewalld.service
  2. [ root@ecs-5c78-0001 ~]# systemctl disable firewalld.service

Close selinux



  1. [ root@ecs-5c78-0001 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  2. [ root@ecs-5c78-0001 ~]# grep SELINUX=disabled /etc/selinux/config
  3. SELINUX=disabled
  4. [ root@ecs-5c78-0001 ~]# setenforce 0
  5. setenforce: SELinux is disabled

Second, the installation and configuration of the database

1、 Before installation, check whether there is MySQL or MariaDB installed using rpm in the system

[ root@ecs-5c78-0001~]# rpm -qa | grep mysql
[ root@ecs-5c78-0001~]# rpm -qa | grep mariadb
mariadb-libs-5.5.52-1.el7.x86_64

2、 If you need to uninstall, execute the command: rpm -e software name, when the execution fails, you can use: rpm -e --nodeps software name to force uninstall, and then use it after uninstall
rpm -qa | grep mysql or rpm -qa | grep mariadb to view the results.

[ root@ecs-5c78-0001~]# rpm -e mariadb-libs-5.5.52-1.el7.x86_64
error: Failed dependencies:
	libmysqlclient.so.18()(64bit) is needed by(installed) postfix-2:2.10.1-6.el7.x86_64
	libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by(installed) postfix-2:2.10.1-6.el7.x86_64
[ root@ecs-5c78-0001~]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

Install mariadb

[ root@ecs-5c78-0001~]# yum install mariadb-server mariadb –y

Start the database and set it to boot



  1. [ root@ecs-5c78-0001 ~]# systemctl start mariadb
  2. [ root@ecs-5c78-0001 ~]# systemctl enable mariadb
  3. Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

Other database operation commands


  1. [ root@ecs-5c78-0001 ~]# systemctl restart mariadb #restart
  2. [ root@ecs-5c78-0001 ~]# systemctl stop mariadb #stop

Three, Zabbix3.4 installation and configuration

1、 Install zabbix (the http:// link here will be updated, you can directly open the website to query the latest RPM package link, and then use rpm -ivh to install)


  1. [ root@ecs-5c78-0001 ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
  2. Retrieving http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
  3. Preparing... ################################# [100%]
  4. Updating / installing... 1:zabbix-release-3.4-1.el7.centos ################################# [100%]
[ root@ecs-5c78-0001~]# yum install zabbix-server-mysql zabbix-web-mysql -y

2、 Create database


  1. [ root@ecs-5c78-0001 ~]# mysql
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is 2
  4. Server version: 5.5.56-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  7. MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
  8. Query OK, 1 row affected (0.00 sec)
  9. MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
  10. Query OK, 0 rows affected (0.00 sec)
  11. MariaDB [(none)]> exit
  12. Bye

3、 Import the database (here zabbix-mysql-3.4.5 note that the version number will be updated)

[ root@ecs-5c78-0001~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.5/create.sql.gz |mysql -uzabbix -pzabbix zabbix

4、 Configure database user and password

[ root@ecs-5c78-0001~]# vim /etc/zabbix/zabbix_server.conf

5、 Modify the following configuration

DBName=zabbix

DBUser=zabbix

DBPassword= changed to》》DBPassword=zabbix

Save and exit: wq

6、 Start zabbix server and set to boot

[ root@ecs-5c78-0001~]# systemctl start zabbix-server.service 
[ root@ecs-5c78-0001~]# systemctl enable zabbix-server.service 
Created symlink from/etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.

7、 Edit zabbix front-end PHP configuration, change the time zone

[ root@ecs-5c78-0001~]# vim /etc/httpd/conf.d/zabbix.conf 

php_value date.timezone Europe/Riga is changed to "" php_value date.timezone Asia/Shanghai

Save and exit: wq

Change to the following

8、 Selinux configuration



  1. [ root@ecs-5c78-0001 ~]# setsebool -P httpd_can_connect_zabbix on
  2. setsebool:  SELinux is disabled.
  3. [ root@ecs-5c78-0001 ~]# setsebool -P httpd_can_cetwork_connect_db on
  4. setsebool:  SELinux is disabled.

9、 Start httpd and set to boot

[ root@ecs-5c78-0001~]# systemctl start httpd
[ root@ecs-5c78-0001~]# systemctl enable httpd
Created symlink from/etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Fourth, configure Zabbix Web information

  1. Browser login local IP: http://192.168.2.216/zabbix/

  1. Click: Next step

  1. Click: Next step

  1. Click: Next step

  1. Confirm the input information, click Next step

  1. Click Finish to generate the configuration file in: /etc/zabbix/web/zabbix.conf.php

View the configuration file:

cat /etc/zabbix/web/zabbix.conf.php

Log in to Zabbix3.4, default user name: Admin default password: zabbix

log in page

Change to Chinese

Zabbix server-side installation is complete!

Five, install and set up Zabbix-agent

Install zabbix-agent

[ root@ecs-5c78-0002~]#  rpm -ivh  https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarh.rpm
Retrieving https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...1:zabbix-release-3.4-1.el7.centos  ################################# [100%][root@ecs-5c78-0002~]#  yum install zabbix-agent –y

Or use the link provided by the official website, and then rpm -ivh to install: rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.0-1.el7.x86_64 .rpm

Configure zabbix-agent

[ root@ecs-5c78-0002~]# vim /etc/zabbix/zabbix_agentd.conf 

Modify server IP address

Modify it to the IP address of the zabbix-server server

Modify ServerActive IP address

Change to the IP address of the zabbix-server server

Start zabbix-agent and set boot to start

[ root@ecs-5c78-0002~]# systemctl start zabbix-agent.service 
[ root@ecs-5c78-0002~]# systemctl enable zabbix-agent.service 
Created symlink from/etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.

Six, Zabbix-server add monitoring host####

Manually add monitoring host

Specify zabbix-agent machine IP

Add a monitoring template, only when the template is added will the host be truly monitored

Add graphics to observe the data

Monitoring is successful (the client must close the firewall or allow the port, or the ZBX icon will report an error in red)

Automatically discover hosts

Add discovery rule

View automatically discovered hosts

At this point, zabbix simple monitoring is deployed.

Centos 7 build zabbix 3.4.5

First of all, I did the zabbix construction work blankly. In fact, I built zabbix 2.4 before building this. I felt that the previous one was too old, and then I pushed it and did it again, feeling full of rewards. In fact, the most important thing is to toss and toss more...

( adsbygoogle = window.adsbygoogle || []).push({});

Recommended Posts

CentOS7.3 64 bit, build Zabbix3.4
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build zabbix monitoring zabbix4.2 in CentOS7.6
CentOS 7.4 install Zabbix 3.4
CentOS 7.3 install Zabbix3
CentOS7 build jenkins
Centos build lnmp
Centos7 build python3.8.5+scrapy+gerapy
centos 6.5 install zabbix 4.4
CentOS build private git
Linux (centos7) build gitlab
Build k8s1.9.9 on centos7
CentOS 8 install ZABBIX4.4 guide
CentOS6.7 build LNMP environment
Zabbix 2.2.20 installation details (Centos6.9)
Centos6.9 build rabbitmq 3.6.8 cluster
Centos7.6 build LNMP environment
Explore Zabbix 5.0 LTS - CentOS 8 (1)
Centos7 build Kubernetes cluster
Jenkins build on centos
Build Hadoop in CentOS
Centos7 build DNS service
CentOS 7 build LNMP environment
Centos 7 install Zabbix 3.4 original
Build docker environment under Centos6.5
CentOs7.3 build Solr stand-alone service
Build OpenV** Server under CentOS7
CentOs7.3 build RabbitMQ 3.6 stand-alone service
Build OpenLDAP server under CentOS7
Build MariaDB replication on CentOS
CentOs7.3 build ZooKeeper-3.4.9 stand-alone service
Install Zabbix 3.4 based on CentOS 7
CentOs7.3 build SolrCloud cluster service
CentOS 8.0.1905 install ZABBIX4.4 version (verified)
CentOS 8 (2)
CentOS8.1 build Gitlab server detailed tutorial
Build a PXC cluster under CentOS8
Centos6 method steps to build gitlab
Build an FTP server under centos7
CentOS 8 (1)
Build Elasticsearch 6.2.4 (centos) based on docker
Build Nginx environment on Linux (CentOS)
(centos7) linux build nginx load balancing build
Centos7 build java web server tomcat
Build Discuz Forum based on CentOS
CentOs7 installation and deployment Zabbix3.4 original
Build Yum private warehouse in Centos7.3
virtualBox install centos, and build tomcat
[Switch] CentOS7 64-bit installation mysql tutorial
Tutorial diagram for installing zabbix2.4 under centos6.5
Build WeChat applet service based on CentOS
Centos7 uses vim to build powerful pyt
Centos 7 64-bit desktop version installation graphic tutorial
Build WeChat applet service based on CentOS
CentOS7 build FastDFS distributed file system (on)
Zabbix installation and deployment and localization under CentOS
(1) Centos7 installation to build a cluster environment
CentOS7 installation zabbix 4.0 tutorial (graphics and text)
[PHP] Build a PHP operating environment under CentOS
Install Mono 2.10.8 and Jexus 5.0 under 32- and 64-bit CentOS 6.0
The fourth installment of Zabbix under CentOs7