[Advanced knowledge of operation and maintenance] Detailed explanation of zabbix5.0 stable version 6 (zabbix automatic monitoring: automatic discovery + automatic registration + active monitoring project)

This article continues to introduce zabbix automated monitoring, including zabbix automatic registration, zabbix automatic discovery, and changing the monitoring items that need to be done after the host is added to the server to active. It is not as simple as monitoring, and it also involves zabbix troubleshooting, alarm suppression, link tracking, etc. at a deeper level.

Table of contents

zabbix automatic discovery

1. Create auto-discovery rules

zabbix automatic registration

1. Configure the automatic registration action

2. Restart the server and client

3. Refresh the host list

Zabbix monitoring project active


zabbix automatic discovery

The zabbix server automatically discovers surviving servers by scanning the address segment, and automatically performs actions after discovery, adding hosts, associating templates, associating alarms, and other operations.

The disadvantage is that the scanning speed is slow, and the server side of zabbix is ​​under great pressure; all scanned clients can only use the same template. For example, the templates used by the Web and the database are different, and manual configuration is required

1. Create auto-discovery rules

0b568813402b43fda1c357dcaf55e6a9.png

ad5544a326174e1cbb69db19979cc181.png

5eddaad213d64c5c963cab304f7bb710.png

Delete the previous host and add an automatic discovery action

Although it is an action, it cannot be viewed in the action log if it is executed

c95ee8a9ba83436a89137243a48acd77.png

06c7563f4e584b668012284029160f15.png8f16b8a0a02347ce856f23e01778c569.png

Restart the zabbix server and the client with IP 172.16.1.7 for testing

[root@Zabbix ~]# systemctl restart zabbix-server.service 
[root@Web01 ~]# systemctl restart zabbix-agent.service 

Refresh the host list and find that a new host with IP 172.16.1.7 has been added 

50bfca36bfb141398f1a144438db0dab.png

And you can see the latest data of the host

548b097a38ab4407bc6b3d91f73afa5c.png

zabbix automatic registration

The role of zabbix automatic registration is opposite to that of automatic discovery. It actively uploads its own information from the client to the server to reduce the pressure on the server.

1. Configure the automatic registration action

Same as automatic discovery, although it is an action, it cannot be viewed in the action log when it is executed, but if it is associated with an email address, you can see the log of the sending email address

Disable the automatic discovery action first to prevent conflicts with automatic registration

8946514e139f4f34b0486cf7034c25bf.png

Select the automatic registration action in the upper left corner --> create action 

1d3a196140364da69ef6f2c8cb6ad920.png

Add action name and condition 

239a151ffc6e4fc3b9750cfc9a91b27e.png

 add operation

939cedbb5047417984e7151a7558bba1.png

17ae759f89254ab9a85b391c447aeda8.png

2. Restart the server and client

Add Web02 to the host 

[root@Zabbix ~]# systemctl restart zabbix-server.service 
[root@Web02 ~]# systemctl restart zabbix-agent.service

3. Refresh the host list

Found successfully registered to the server 

7bf8065639594b34be024fad30b0aff1.png

You can also check the latest data

a42577bf83b94c9e8eaa495d979b9244.png

The email was also sent successfully 

7738e56afaaf4aa58561a95b4da572a7.png

You can see the action log sent by email

c1c1995cb7dd481eac29de628041f53e.png

Zabbix monitoring project active

Both zabbix automatic discovery and automatic registration add the client to the server, but after adding it, the server needs to continuously monitor the monitoring items and obtain data. We can adjust the monitoring items of the host according to the needs. Active or passive

For example, when there are more than 300 servers, when the network is complex, and when the server configuration is general, we can modify the monitoring item to be active. Next, I will configure the client monitoring item named Web02 as active to reduce service end pressure.

1. Observe the latest data, check the inspection records, you can see that the data is inspected sequentially, because the zabbix server is inspected sequentially.

dc0a49efa46c43449a3c9631956ebbb2.png

2. Modify the monitoring item from passive to active, first modify the configuration file 

[root@Web02 ~]# cat /etc/zabbix/zabbix_agentd.conf
......
# ServerActive=127.0.0.1
ServerActive=172.16.1.71    # 主动注册服务器地址
......
# Hostname=Zabbix server
Hostname=Web02              # 必须设置为主机名称
[root@Web02 ~]# systemctl restart zabbix-agent.service

3. Modify the template associated with the automatic registration just now

7f0fe475389e42bf9d05267b1570c462.png

Change template os linux by zabbix agent to template os linux by zabbix agent active, the former is passive monitoring and the latter is active monitoring

b5996c16904e4ddd8b8a295bfff9b172.png

181335316b014622ab77bf2576ebf354.png

 

After the modification, the host that is actively registered later is active, but the registered host template has not changed. We can delete the host and let it automatically register, or click on the host to relink the new template

406f594df2af4c9f8156ac1aea65f2aa.png

Check the latest data again, and find that the inspection records are all at the same point in time, indicating that the mode has been successfully modified to active.

88c940f52fb04bbf98241b7f600490bc.png

The above is the active template given by the official. As for our own custom monitoring items, we can customize the type when creating

264a50366ded4852be004c0b974109ae.png


I am koten, with 10 years of experience in operation and maintenance, and I continue to share dry goods in operation and maintenance. Thank you for your reading and attention!

 

Guess you like

Origin blog.csdn.net/qq_37510195/article/details/130893655