2 User macros supported by location

Overview

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

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
Time period conditionno
Operations
Default operation step durationno
Step durationno

Hosts

In a host 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
Name (deprecated)yes
Item key parametersyes
Update intervalno
Custom intervalsno
History storage periodno
Trend storage periodno
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
SNMP agent
SNMP OIDyes
SSH agent
Usernameyes
Public key fileyes
Private key fileyes
Passwordyes
Scriptyes
TELNET agent
Usernameyes
Passwordyes
Scriptyes
Zabbix trapper
Allowed hostsyes
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
Nameyes
Key parametersyes
Update intervalno
Custom intervalno
Keep lost resources periodno
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

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 (including confirmation text)yes
Monitoring → Screens
URL2 field of dynamic URL screen elementyes
Administration → Users → Media
When activeno
Administration → General → Working time
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 “******“.