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

MySQL login and exit command format

The command format for mysql login is: mysql -h [...

CSS style does not work (the most complete solution summary in history)

When we write pages, we sometimes find that the C...

Steps for importing tens of millions of data into MySQL using .Net Core

Table of contents Preliminary preparation Impleme...

Intellij IDEA quick implementation of Docker image deployment method steps

Table of contents 1. Docker enables remote access...

Difference between MySQL btree index and hash index

In MySQL, most indexes (such as PRIMARY KEY, UNIQ...

Deployment and configuration of Apache service under Linux

Table of contents 1 The role of Apache 2 Apache I...

Analysis and solution of a.getAttribute(href,2) problem in IE6/7

Brief description <br />In IE6 and 7, in a ...

Meta viewport makes the web page full screen display control on iPhone

In desperation, I suddenly thought, how is the Sin...

mysqldump parameters you may not know

In the previous article, it was mentioned that th...

How to view the type of mounted file system in Linux

Preface As you know, Linux supports many file sys...

Detailed explanation of mysql.user user table in Mysql

MySQL is a multi-user managed database that can a...

Detailed explanation of MySQL combined index and leftmost matching principle

Preface I have seen many articles about the leftm...

jQuery achieves seamless scrolling of tables

This article example shares the specific code of ...