Zabbix monitoring solution - the latest official version 4.4 [recommended]

Zabbix monitoring solution - the latest official version 4.4 [recommended]

Zabbix

2019/10/12 Chenxin

refer to
https://www.zabbix.com/documentation/4.0/en/manual
https://baike.baidu.com/item/zabbix/6780368?fr=aladdin

Introduction

Zabbix is ​​an enterprise-level open source solution that provides distributed system monitoring and network monitoring capabilities based on a WEB interface.

Zabbix can monitor various network parameters to ensure the safe operation of the server system; and provide a flexible notification mechanism to allow system administrators to quickly locate/solve various existing problems.

Zabbix consists of two parts, Zabbix server and the optional component Zabbix agent.

Zabbix server can provide remote server/network status monitoring, data collection and other functions through SNMP, Zabbix agent, ping, port monitoring and other methods. It can run on Linux, Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X and other platforms.

Similar products include Grafana, Nagios, Ganglia, Open-Falcon, etc.

Server Installation and Deployment

Refer to https://www.zabbix.com/download?zabbix=4.4&os_distribution=centos&os_version=8&db=mysql for installation and connection instructions

The latest Zabbix-4.4 version is installed here.

This experiment address description

Server: 192.168.143.130
Agent: 192.168.143.130,131

1. Choose a platform

Select the Zabbix version/OS type/OS version/Database type, etc.

Then different installation and connection instructions will be given according to the user's selection. Here we take Zabbix4.4, Centos7, MySQL database as an example.

2. Install according to the above selection

a. Install Zabbix source

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm #Load the source of zabbix yum clean all
ls /etc/yum.repos.d/
... zabbix.repo #Add this file

b. Install Zabbix server, frontend, agent

# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent (zabbix components, may need to be executed multiple times due to network speed issues)

Error 1. Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

This indicates that deltarpm is not installed. Run the command to view the package information.

yum provides '*/applydeltarpm' #Check the location of the dependent package, the prompt is as follows deltarpm-3.6-3.el7.x86_64: Create deltas between rpms #Prompts the package to be installed deltarpm-3.6-3.el7.x86_64
Repo: @base
Matched from:
Filename : /usr/bin/applydeltarpm

Execute the installation command

yum -y install deltarpm #安裝命令

If it still happens, it means that it is caused by network problems (the speed is too slow), then try multiple times (each time you download, the progress will increase and enter the cache)

c. Initialize the database and import the table structure

Initialize the database (MySQL version is 5.7)

create database zabbix character set utf8 collate utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'sj...sg';
CREATE USER 'zabbix'@'%' IDENTIFIED BY 'sj...sg';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@localhost;

Importing data structures

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

d. Modify the DB configuration file of zabbix server

vim /etc/zabbix/zabbix_server.conf
DBHost=192.168.143.130
DBPassword=xxx
DBPort=10306
DBSocket=/tmp/mysql.sock

e. Modify the PHP configuration file on the front end of the zabbix server

vim /etc/httpd/conf.d/zabbix.conf, uncomment and set the correct time zone (Asia/Shanghai)
php_value date.timezone Europe/Riga

f. Start the Zabbix server and Agent process. Set it to start automatically at boot.

Start the service

# systemctl restart zabbix-server zabbix-agent httpd

The actual call is

/usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
/usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
/usr/sbin/httpd

Set up auto-startup

# systemctl enable zabbix-server zabbix-agent httpd

Process open port description

zabbix_agentd 10050
zabbix_server 10051
httpd 80

After the above steps, zabbix is ​​running.

Configure Zabbix frontend (frontend entry configuration)

http://192.168.143.130/zabbix

For configuration methods, please refer to https://www.zabbix.com/documentation/4.4/manual/installation/install#installing_frontend for screenshots of front-end configuration.

Or follow the following process (same as the official website).

Process Description

1. Enter the welcome page

2. Confirm whether all relevant plug-ins have been installed. If there are any unfinished ones, you can install them manually.

3. Enter the DB configuration interface and enter the IP, PORT, dbname, username, and password of the Zabbix database.

4. Enter the relevant information of zabbix server (host name/IP, open port 10051, Name can be empty).

After completion, the page prompts as follows

Congratulations! You have successfully installed Zabbix frontend.
Configuration file "/etc/zabbix/web/zabbix.conf.php" created.

<?php
// Zabbix GUI configuration file.
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = '192.168.143.130';
$DB['PORT'] = '10306';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'sj...sg';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';
$ZBX_SERVER = '192.168.143.130';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = '';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

First login

Log in to zabbix web for the first time, account Admin (note the capital "A"), password zabbix.

Using Zabbix

https://www.zabbix.com/documentation/4.4/manual/quickstart/login

There are also video tutorials.

Mainly for monitoring project viewing.

Creation of DashBoard.

Adding clients.

After the client is shut down, "Monitoring"->"Instrument"/"Problem" all show abnormal descriptions (a host is down).

Template usage (association, creation)

Alarm use.

Zabbix client (agent) separate installation/host creation

Monitored host IP: 192.168.143.131

1 Install the Agent

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum clean all
yum install zabbix-agent -y #Due to network reasons, you may need to execute multiple times

2. Modify the configuration file

cat zabbix_agentd.conf |grep -v -E "(^#|^$)"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1 #Change to 192.168.143.130
ServerActive=127.0.0.1 #Change to 192.168.143.130
Hostname=Zabbix server # This can be changed to other names Include=/etc/zabbix/zabbix_agentd.d/*.conf

3. Configure the host on zabbix-web

Select "Configuration" -> "Hosts" -> "Create Host". Then

Select the "Host" column, enter the host name, group (created in advance), host IP and port

Select the "Template" column and select the corresponding template (monitoring item).

Click "Add".

Then go to "Monitoring" -> "Latest Data" to check whether the data acquisition is normal.

Zabbix related directories and file descriptions

1. Important directory instructions

/etc/zabbix #Contains zabbix_agentd.conf, zabbix_agentd.d/, zabbix_server.conf
/etc/httpd/conf.d/zabbix.conf #http configuration /usr/share/zabbix/ #web root directory /var/log/zabbix/ #log storage directory

2. Other related directories (lib directory, man, doc directory omitted)

/usr/lib/systemd/system/zabbix-server.service,zabbix-agent.service #Service /usr/sbin/zabbix_server,zabbix_server_mysql,zabbix_agentd #Binary /etc/yum.repos.d/zabbix.repo # Source /etc/logrotate.d/zabbix-server,zabbix-agent #Log rollback method /etc/selinux/targeted/active/modules/100/zabbix/ #Binary/run/zabbix #Run directory

User Management

Supports management of local users and groups.

Support LDAP, the specific configuration is omitted.

Call the police

Support Mail/GSM-modem (hardware connection to server) mode.

Other notes

The monitoring page console supports Chinese.

Support page theme changes.

Summarize

The above is the Zabbix monitoring solution introduced by the editor - the official latest 4.4 version. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Distributed monitoring system Zabbix 3.2 adds automatic discovery of disk IO and registration monitoring (recommended)
  • How to obtain information from ZabbixAPI and implement Zabbix-API monitoring in Python
  • How to use zabbix to monitor mongodb
  • Basic tutorial on installing and configuring Zabbix to monitor MySQL
  • How to set up Zabbix monitoring switch
  • Analyze the problem of Zabbix 5.0 disk automatic discovery and read-write monitoring

<<:  Analyze how uniapp dynamically obtains the interface domain name

>>:  Manually implement js SMS verification code input box

Recommend

Solution to large line spacing (5 pixels more in IE)

Copy code The code is as follows: li {width:300px...

Example verification MySQL | update field with the same value will record binlog

1. Introduction A few days ago, a development col...

Lombok implementation JSR-269

Preface Introduction Lombok is a handy tool, just...

Use PHP's mail() function to send emails

Sending emails using PHP's mail function The ...

Implementation of Vue top tags browsing history

Table of contents nonsense Functions implemented ...

React native realizes the monitoring gesture up and down pull effect

React native implements the monitoring gesture to...

Analysis and treatment of scroll bars in both HTML and embedded Flash

We often encounter this situation when doing devel...

CSS float (float, clear) popular explanation and experience sharing

I came into contact with CSS a long time ago, but...

CSS--overflow:hidden in project examples

Here are some examples of how I use this property ...

Server concurrency estimation formula and calculation method

Recently, I need to stress test the server again....

Nginx domain name SSL certificate configuration (website http upgraded to https)

Preface HTTP and HTTPS In our daily life, common ...

A complete guide to CSS style attributes css() and width() in jQuery

Table of contents 1. Basic use of css(): 1.1 Get ...

Detailed explanation of how to use zabbix to monitor oracle database

1. Overview Zabbix is ​​a very powerful and most ...

A simple way to build a Docker environment

First, let’s understand what Docker is? Docker is...