ZABBIX monitoring scheme – the latest official version 4.4 [recommended]

Time:2021-7-31

Zabbix

2019/10/12 Chenxin

reference resources
https://www.zabbix.com/documentation/4.0/zh/manual
https://baike.baidu.com/item/zabbix/6780368?fr=aladdin

brief introduction

ZABBIX is an enterprise class open source solution based on web interface to provide distributed system monitoring and network monitoring functions.

ZABBIX can monitor various network parameters to ensure the safe operation of the server system; Flexible notification mechanism is provided to enable system administrators to quickly locate / solve various problems.

ZABBIX consists of two parts, ZABBIX server and 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, and 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

reference resources https://www.zabbix.com/download?zabbix=4.4&os_ distribution=centos&os_ Version = 8 & DB = MySQL installation and connection instructions

The latest version of ZABBIX – 4.4 is installed here

Address description of this experiment

Server: 192.168.143.130
Agent: 192.168.143.130,131

1、 Select platform

Select ZABBIX version / operating system category / operating system version / database category, etc

Then, different installation and connection instructions will be given according to different user choices. Here, take zabbix4.4, centos7 and MySQL databases as examples

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 # more than this file

b. Install ZABBIX server, frontend, agent

#Yum - y install ZABBIX server MySQL ZABBIX web MySQL ZABBIX Apache conf ZABBIX agent (ZABBIX component may need to be executed multiple times due to network speed)

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

Description: deltarpm is not installed. Execute to view the package information

Yum provides' * / applydeltarpm '# view the location of dependent packages with the following prompt
deltarpm-3.6-3.el7.x86_ 64: create deltas between RPMs # prompts the package to be installed deltarpm-3.6-3.el7.x86_ sixty-four
Repo  : @base
Matched from:
Filename : /usr/bin/applydeltarpm

Execute installation command

yum -y   install deltarpm   # Installation command

If the problem persists, it indicates that it is caused by a network problem (the network speed is too slow), then you can try it many times (the progress will increase every time you download. Enter the cache)

c. Initialize database and import 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;

Import data structure


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

d. Modify 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 of ZABBIX server front end

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 the agent process. Set the startup self – startup

Start 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 startup and self 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 ran

Configure ZABBIX front end (front end enters configuration)

http://192.168.143.130/zabbix

The configuration method can refer to https://www.zabbix.com/documentation/4.4/manual/installation/install#installing_ Screenshot description of front end configuration in the front end link

Or follow the following procedure (the 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 unfinished plug-ins, they can be installed manually

3. Enter the DB configuration interface and enter the IP, port, dbname, username and password of 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 landing

Log in ZABBIX web for the first time, account admin (note “a” in uppercase) and password ZABBIX

Using ZABBIX

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

There are also video tutorials

It is mainly used to view monitoring items

Creation of dashboard

Add client

After the client is shut down, abnormal instructions are displayed in “monitoring” – > “instrument” / “problem” (a host is down)

Use of template (Association, new)

Alarm usage

Separate installation of ZABBIX’s client (agent) / creation of host

Monitored host IP: 192.168.143.131

1 install 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# network reason, it may need to be executed 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 # modified to 192.168.143.130
Serveractive = 127.0.0.1 # modified to 192.168.143.130
Hostname = ZABBIX server # here can be changed to other names
Include=/etc/zabbix/zabbix_agentd.d/*.conf

3. Configure the host on ZABBIX Web

Select Configure – > host – > create host, and then

Select the “host” column and enter the host name, group (built 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 data acquisition is normal

Description of ZABBIX related directories and documents

1. Description of important contents

/Etc / ZABBIX # including ZABBIX_ agentd.conf,zabbix_ agentd.d/,zabbix_ server.conf
/Etc / httpd / conf.d/zabbix.conf #http configuration
/Usr / share / ZABBIX / #web root
/Var / log / ZABBIX / # log storage directory

Other directories (LIB. Man, Doc. Man, omitted)

/Usr / lib / SYSTEMd / system / zabbix-server.service, zabbix-agent.service # service
/usr/sbin/zabbix_ server,zabbix_ server_ mysql,zabbix_ Agentd # binary
/Yum / etc.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

Support the management of local users and groups

Support LDAP, the specific configuration is omitted

call the police

Support mail / GSM modem (hardware connection server) mode

Other instructions

The monitoring page console supports Chinese

Support page theme change

summary

The above is the latest version 4.4 of ZABBIX monitoring scheme introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support to the developeppaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!