Zabbix5.0 installation and deployment

Posted by garg_vivek on Thu, 02 Dec 2021 19:31:36 +0100

Zabbix is a network monitoring and management system developed by Alexei Vladishev, which is based on server client architecture. It can be used to monitor the status of various network services, servers and network machines.

Zabbix can be said to be one of the software that operation and maintenance personnel must master.

The installation steps are as follows

Close the protective wall and prohibit self starting

[root@zabbix ~]# systemctl stop firewalld
[root@zabbix ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Shut down selinux and restart it to take effect

[root@zabbix ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/'  /etc/selinux/config

[root@zabbix ~]# shutdown -r now
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(zabbix server) at 21:56:31.

Get zabbix official software source

[root@zabbix ~]#  rpm -Uvh

Change the zabbix image source to Alibaba cloud

[root@zabbix ~]# sed -i 's#' /etc/yum.repos.d/zabbix.repo

  Clean up some unnecessary software sources

[root@zabbix ~]# yum clean all
 Plug in loaded: fastestmirror
 Cleaning up software source: base extras updates zabbix zabbix-non-supported
Cleaning up list of fastest mirrors

To install the mysql service, you can choose mariadb from centos or install it yourself. If you need to read the article yourself

mysql(rpm package) installation and configuration under Linux(centos7)_ GLGN blog - CSDN blog software package preparation Baidu online disk: link: Extraction code: 0601 alicloud link:[root@zabbix software]# ll total usage 206280-rw-r -- R --. 1 root 26597364 November 30 20:31 mysql-community-client-5.7.34-1.el7.x86_64.rp.. After installing mysql

You also need to install the lib package  

Baidu online disk link:  
Extraction code: 0601

Alibaba cloud   Link:

[root@zabbix software]# rpm -ivh mysql-community-libs-compat-5.7.34-1.el7.x86_64.rpm 

Install zabbix server and zabbix agent services

[root@zabbix software]# yum install zabbix-server-mysql zabbix-agent -y

Install software sets to avoid conflicts caused by different software versions

[root@zabbix software]# yum install centos-release-scl -y

Modify ZABBIX front end source    vim /etc/yum.repos.d/zabbix.repo  

Just modify enabled in frontend

  Installing the zabbix front end environment

[root@zabbix software]# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y

Login database

[root@zabbix software]# mysql -uroot -p
Enter password:Database password

Create the database required by zabbix

#Create database
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
#Modify the database policy so that we can set weak type passwords later
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)
#Create database user
mysql> create user zabbix@localhost identified by '123456';
Query OK, 0 rows affected (0.01 sec)
#to grant authorization
mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)
#Refresh for configuration to take effect
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
#sign out

Import file into zabbix database

[root@zabbix software]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:  #Password 123456

Modifying the zabbix server configuration file vim  / etc/zabbix/zabbix_server.conf

  Modify the time zone vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf in the PHP configuration file of ZABBIX

  Change to

  Start service  

[root@zabbix software]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm

Set service startup and self startup

[root@zabbix software]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/zabbix-server.service.
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/zabbix-agent.service.
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/rh-php72-php-fpm.service.

Log in to the browser to configure the host IP/zabbix of the service. Here I am

Click Next until you need to enter the database password. Follow the steps of the blogger   The password is 123456

  Then continue to click the next step to finish

  When you come to the login interface, the account is Admin and the password is zabbix. Note the case

  Modify the language setting to Chinese   Click update

  Install font to solve garbled code

[root@zabbix software]# yum -y install wqy-microhei-fonts
\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

The next article describes how to configure add clients, that is, the monitored hosts

Topics: Operation & Maintenance Zabbix server