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
The active mode refreshes all in one second
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
Click on monitoring items and select all
Click batch update
Click to modify the type to zabbix client (active)
The modification has been completed, and there are some monitoring items that cannot be active in active mode
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.
2.3. Check whether the template of the host link is valid
Configuration-host-monitoring items-type selection zabbix client (active)
Already in active mode