"Zabbix"-Set Active Mode and Passive Mode@20210224

This note will record how to configure active mode monitoring and passive mode monitoring. (1) In the default configuration (Zabbix Server), all monitoring items default to passive mode. (2) zabbix agent can run two types of checks at the same time.

Environment overview

Software version: Zabbix 4.2

Configure Active Mode (Active checks)

The first step is to modify the zabbix agent configuration

(Configuration) Modify the /etc/zabbix/zabbix_agentd.conf file:

# Disable passive checking (not recommended: because both active and passive are used in the default template) 
# StartAgents=0 

# zabbix agent will pull monitoring items from the zabbix server 
ServerActive=zabbix.example.com 

# current host name for Indicates the host, which will be used in the zabbix server configuration 
# => It is recommended to use the HostnameItem parameter 
# Hostname=zabbix_client 

# If the Hostname parameter is not configured, the HostnameItem parameter will be used to automatically obtain the host name. If the HostnameItem 
# parameter is also not configured, the actual system host name will be used (but may not be the expected value). 
# Use zabbix_get -s127.0.0.1 -k system.hostname to view the host name. 
HostnameItem=system.hostname

(Restart) Other parameters remain unchanged, restart zabbix agent service.

The second step, modify the Zabbix Server configuration

Create active mode template (clone the passive template, change all items to Zabbix agent(Active) type):

	(1)Configuration => Template => **Template OS Linux** => Full clone => **Template name: Template OS Linux Active** => Add
	(2)**Template name: Template OS Linux Active** => Linked templates => Linked templates => Unlink
	(3)**Template name: Template OS Linux Active** => Items => Select all => Mass update => **Type: Zabbix agent(Active)** => Update

Check whether the data exists in Graph later.

Supplementary note

If multiple zabbix agents configure the same Hostname parameter, the data collected to the zabbix server will be confused, and "jitter" will appear in the figure.

Configure passive mode (Passive checks)

The first step is to modify the zabbix agent configuration

(Configuration) Modify the /etc/zabbix/zabbix_agentd.conf file:

# Allow connection to the current zabbix agent 
zabbix server Server=127.0.0.1, zabbix.example.com

(Restart) Other parameters remain unchanged, restart zabbix agent service.

Additional information

In Zabbix 4.4, the active monitoring template is already attached, so there is no need to create it manually.

related articles

"Zabbix"-items (Items)
"Zabbix"-Chinese font "garbled" (no Chinese font)

references

Active mode and passive mode of monitoring tool Zabbix
Configure active zabbix agent
zabbix agent: Active vs. Passive

Guess you like

Origin blog.csdn.net/u013670453/article/details/114036355