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/multi-user.target.wants/firewalld.service.
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 https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

Change the zabbix image source to Alibaba cloud

[root@zabbix ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /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: https://pan.baidu.com/s/1h7kyhiBwlPKyRaTJtmop3Q Extraction code: 0601 alicloud link: https://www.aliyundrive.com/s/3BqiZmsfUJX[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..https://blog.csdn.net/qq_57193542/article/details/121642197?spm=1001.2014.3001.5501 After installing mysql

You also need to install the lib package  

Baidu online disk link: https://pan.baidu.com/s/1cRdH6x19eIQL3b8b9xCEVw  
Extraction code: 0601

Alibaba cloud   Link: https://www.aliyundrive.com/s/JetCzaAv5Pi

[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
quit;

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/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/rh-php72-php-fpm.service 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 192.168.83.131/zabbix

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