The difference between zabbix active mode and passive mode and detailed configuration (21)

zabbix active mode and passive mode

1. Introduction to zabbix active and passive mode

  • Passive mode: In passive mode, zabbix server sends instructions to zabbix agent to obtain data, that is, zabbix agent passively obtains data and returns to zabbix server, zabbix server periodically requests data from agent. The biggest problem of this overall mode is that it will increase The workload of zabbix server, in the environment of hundreds of servers, zabbix server cannot get the latest data in time, but this is also the default working mode.
  • The active mode is that zabbix agent actively collects data and returns it to zabbix server, no more intervention by zabbix serve, so the active mode can reduce the pressure of zabbix server to a certain extent

When optimizing zabbix, the active mode optimization will greatly reduce the pressure of zabbix server

In short: the passive mode is that zabbix-sevrer actively asks for data from zabbix-agent. If thousands of servers need to ask for data each time, it will be very slow, which will affect the refresh of the monitoring value. The active mode is the active image of zabbix-agent. Zabbix-sever reports data, which is like sending a notice, everyone is here to gather, which can greatly reduce the pressure on zabbix server

Passive mode refreshes the monitoring items every time almost every second

Insert picture description here

The active mode refreshes all in one second

Insert picture description here

2. Change the monitored host from passive mode to active mode

2.1. Configure zabbix agent

192.168.81.220配置
[root@192_168_81_220 ~]# vim /etc/zabbix/zabbix_agentd.conf 
Server=192.168.81.210
ServerActive=192.168.81.210
Hostname=192.168.81.220
[root@192_168_81_220 ~]# systemctl restart zabbix-agent

192.168.81.230配置
[root@192_168_81_230 ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.81.210
ServerActive=192.168.81.210
Hostname=192.168.81.230
[root@192_168_81_230 ~]# systemctl restart zabbix-agent

2.2. Modify the passive mode of the monitoring host to the active mode

We can modify the template directly

Configuration—Template—Template OS Linux system

Insert picture description here

Click on monitoring items and select all
Insert picture description here

Click batch update

Insert picture description here

Click to modify the type to zabbix client (active)

Insert picture description here

The modification has been completed, and there are some monitoring items that cannot be active in active mode

Insert picture description here

It is easy to test. It is recommended to change the update time to the same. After all, the update time can be changed to the same. After all, it is basic monitoring.

Insert picture description here

2.3. Check whether the template of the host link is valid

Configuration-host-monitoring items-type selection zabbix client (active)
Insert picture description here

Already in active mode

Insert picture description here

2.4. View the refresh frequency of data

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44953658/article/details/115369058