2 User macros supported by location

Overview

This section contains a list of locations, where user-definable macros are supported.

Only global-level user macros are supported for Actions, Network discovery, Proxies and all locations listed under Other locations section of this page. In the mentioned locations, host-level and template-level macros will not be resolved.

Actions

In actions, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Trigger-based notifications and commandsyes
Trigger-based internal notificationsyes
Problem update notificationsyes
Service-based notifications and commandsyes
Service update notificationsyes
Time period conditionno
Operations
Default operation step durationno
Step durationno

Hosts/host prototypes

In a host and host prototype configuration, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Interface IP/DNSDNS only
Interface portno
SNMP v1, v2
SNMP communityyes
SNMP v3
Context nameyes
Security nameyes
Authentication passphraseyes
Privacy passphraseyes
IPMI
Usernameyes
Passwordyes
Tags
Tag namesyes
Tag valuesyes

Items / item prototypes

In an item or an item prototype configuration, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Item key parametersyes
Update intervalno
Custom intervalsno
History storage periodno
Trend storage periodno
Descriptionyes
Calculated item
Formulayes
Database monitor
Usernameyes
Passwordyes
SQL queryyes
HTTP agent
URL2yes
Query fieldsyes
Timeoutno
Request bodyyes
Headers (names and values)yes
Required status codesyes
HTTP proxyyes
HTTP authentication usernameyes
HTTP authentication passwordyes
SSl certificate fileyes
SSl key fileyes
SSl key passwordyes
Allowed hostsyes
JMX agent
JMX endpointyes
Script item
Parameter names and valuesyes
SNMP agent
SNMP OIDyes
SSH agent
Usernameyes
Public key fileyes
Private key fileyes
Passwordyes
Scriptyes
TELNET agent
Usernameyes
Passwordyes
Scriptyes
Zabbix trapper
Allowed hostsyes
Tags
Tag namesyes
Tag valuesyes
Preprocessing
Step parameters (including custom scripts)yes

Low-level discovery

In a low-level discovery rule, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Key parametersyes
Update intervalno
Custom intervalno
Keep lost resources periodno
Descriptionyes
SNMP agent
SNMP OIDyes
SSH agent
Usernameyes
Public key fileyes
Private key fileyes
Passwordyes
Scriptyes
TELNET agent
Usernameyes
Passwordyes
Scriptyes
Zabbix trapper
Allowed hostsyes
Database monitor
Additional parametersyes
JMX agent
JMX endpointyes
HTTP agent
URL2yes
Query fieldsyes
Timeoutno
Request bodyyes
Headers (names and values)yes
Required status codesyes
HTTP authentication usernameyes
HTTP authentication passwordyes
Filters
Regular expressionyes
Overrides
Filters: regular expressionyes
Operations: update interval (for item prototypes)no
Operations: history storage period (for item prototypes)no
Operations: trend storage period (for item prototypes)no

Network discovery

In a network discovery rule, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Update intervalno
SNMP v1, v2
SNMP communityyes
SNMP OIDyes
SNMP v3
Context nameyes
Security nameyes
Authentication passphraseyes
Privacy passphraseyes
SNMP OIDyes

Proxies

In a proxy configuration, user macros can be used in the following field:

LocationMultiple macros/mix with text1
Interface port (for passive proxy)no

Templates

In a template configuration, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Tags
Tag namesyes
Tag valuesyes

Triggers

In a trigger configuration, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Nameyes
Operational datayes
Expression (only in constants and function parameters; secret macros are not supported).yes
Descriptionyes
URL2yes
Tag for matchingyes
Tags
Tag namesyes
Tag valuesyes

Web scenario

In a web scenario configuration, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Nameyes
Update intervalno
Agentyes
HTTP proxyyes
Variables (values only)yes
Headers (names and values)yes
Steps
Nameyes
URL2yes
Variables (values only)yes
Headers (names and values)yes
Timeoutno
Required stringyes
Required status codesno
Authentication
Useryes
Passwordyes
SSL certificateyes
SSL key fileyes
SSL key passwordyes
Tags
Tag namesyes
Tag valuesyes

Other locations

In addition to the locations listed here, user macros can be used in the following fields:

LocationMultiple macros/mix with text1
Global scripts (script, SSH, Telnet, IPMI), including confirmation textyes
Webhooks
JavaScript scriptno
JavaScript script parameter nameno
JavaScript script parameter valueyes
Monitoring → Dashboards
Description field of Item value dashboard widgetyes
URL2 field of dynamic URL dashboard widgetyes
Administration → Users → Media
When activeno
Administration → General → GUI
Working timeno
Administration → Media types → Message templates
Subjectyes
Messageyes

For a complete list of all macros supported in Zabbix, see supported macros.

Footnotes

1 If multiple macros in a field or macros mixed with text are not supported for the location, a single macro has to fill the whole field.

2 URLs that contain a secret macro will not work, as the macro in them will be resolved as “******“.