This is the seventh day of my participation in the First Challenge 2022. For details: First Challenge 2022.

Zabbix can monitor various network parameters to ensure the safe operation of the server system. It also provides a flexible notification mechanism for system administrators to quickly locate and solve various problems. It consists of two parts: Zabbix Server and optional Zabbix Agent. Zabbix Server can use SNMP, Zabbix Agent, ping, port monitoring and other methods to provide remote server/network status monitoring, data collection and other functions, it can run on Linux, Solaris, HP-UX, AIX, Free BSD, Open BSD, On platforms like OS X.

This installation and configuration chooses the basic configuration of OVERSEAS 1C1G25G of Tencent Cloud lightweight application server as the experimental environment for reference.

1. Update the system software

Enter the following command on the Tencent Cloud Webshell terminal and press Enter to update the system software.

yum update -y

When you see the word Complete, you have completed the system software update.

2. Install the MySQL database

Run the following command to check whether MariaDB is installed in the system.

rpm -qa | grep -i mariadb

If the following information is displayed, MariaDB exists:

To avoid conflicts caused by different installation versions, run the following command to remove the installed MariaDB.

Yum -y remove The package name

If the command output is empty, the installation is not preinstalled. Go to the next step.

Run the following command to create the MariaDB. Repo file in /etc/yum.repos.d/.

vim /etc/yum.repos.d/MariaDB.repo

Press “I” to switch to edit mode and write the following.

# MariaDB 10.4 CentOS Repository list - Created 2019-11-05 11:56 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.4/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck = 1Copy the code

Press Esc and enter :wq to save the file and return to the vi editor.

Run the following command to install MariaDB. And set mariadb to start automatically after startup

yum install -y mariadb-server

systemctl start mariadb

systemctl enable mariadb

When you see Created symlink from/etc/systemd/system/multi – user. Target. Wants/mariadb. Service to /usr/lib/systemd/system/mariadb.service. Is displayed, the MySQL database has been installed.

3. Initialize the MySQL database

Run the following command to initialize the database.

mysql_secure_installation

The specific operation process is as follows

When you see Thanks for using MariaDB! “, you are finished configuring MariaDB.

4. Install Zabbix warehouse

Run the following command to install the Zabbix repository

The RPM - Uvh < https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm >

dnf clean all

When you see the Cleaning Up List of Fastest mirrors output, you have installed the official Zabbix warehouse

5. Install the Zabbix Server, Web front-end, and Agent

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-agent

6. Create a database for Zabbix

Enter mysql -uroot -p and the password to log in to the mysql database.

Create a database named Zabbix and create a user named Zabbix with password to manage the Zabbix database.

create database zabbix character set utf8 collate utf8_bin;

create user zabbix@localhost identified by 'password';

grant all privileges on zabbix.* to zabbix@localhost;

quit;

7. Import default Zabbix Server data

After the database is created, you can import the default database data

Enter the following code on the command line to import the default data:

zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p zabbix

8. Start the Zabbix Server and Agent processes

Start the Zabbix server and Agent processes and set them to boot automatically:

systemctl restart zabbix-server zabbix-agent httpd php-fpm

systemctl enable zabbix-server zabbix-agent httpd php-fpm

9. Configure the Web server

Open a browser and visit http://server IP address /zabbix for subsequent installation. After the installation is complete, use the user name Admin and password zabbix to log in to Zabbix

Zabbix is successfully deployed on the Web