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.
In actions, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Trigger-based notifications and commands | yes | |
Trigger-based internal notifications | yes | |
Problem update notifications | yes | |
Service-based notifications and commands | yes | |
Service update notifications | yes | |
Time period condition | no | |
Operations | ||
Default operation step duration | no | |
Step duration | no |
In a host and host prototype configuration, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Interface IP/DNS | DNS only | |
Interface port | no | |
SNMP v1, v2 | ||
SNMP community | yes | |
SNMP v3 | ||
Context name | yes | |
Security name | yes | |
Authentication passphrase | yes | |
Privacy passphrase | yes | |
IPMI | ||
Username | yes | |
Password | yes | |
Tags2 | ||
Tag names | yes | |
Tag values | yes |
In an item or an item prototype configuration, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Item key parameters | yes | |
Update interval | no | |
Custom intervals | no | |
History storage period | no | |
Trend storage period | no | |
Description | yes | |
Calculated/aggregate item | ||
Formula (expression constants and function parameters; item key parameters; (aggregate item only) filter conditions (host group name and tag name)) | yes | |
Database monitor | ||
Username | yes | |
Password | yes | |
SQL query | yes | |
HTTP agent | ||
URL3 | yes | |
Query fields | yes | |
Timeout | no | |
Request body | yes | |
Headers (names and values) | yes | |
Required status codes | yes | |
HTTP proxy | yes | |
HTTP authentication username | yes | |
HTTP authentication password | yes | |
SSl certificate file | yes | |
SSl key file | yes | |
SSl key password | yes | |
Allowed hosts | yes | |
JMX agent | ||
JMX endpoint | yes | |
Script item | ||
Parameter names and values | yes | |
SNMP agent | ||
SNMP OID | yes | |
SSH agent | ||
Username | yes | |
Public key file | yes | |
Private key file | yes | |
Password | yes | |
Script | yes | |
TELNET agent | ||
Username | yes | |
Password | yes | |
Script | yes | |
Zabbix trapper | ||
Allowed hosts | yes | |
Tags2 | ||
Tag names | yes | |
Tag values | yes | |
Preprocessing | ||
Step parameters (including custom scripts) | yes |
In a low-level discovery rule, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Key parameters | yes | |
Update interval | no | |
Custom interval | no | |
Keep lost resources period | no | |
Description | yes | |
SNMP agent | ||
SNMP OID | yes | |
SSH agent | ||
Username | yes | |
Public key file | yes | |
Private key file | yes | |
Password | yes | |
Script | yes | |
TELNET agent | ||
Username | yes | |
Password | yes | |
Script | yes | |
Zabbix trapper | ||
Allowed hosts | yes | |
Database monitor | ||
Username | yes | |
Password | yes | |
SQL query | yes | |
JMX agent | ||
JMX endpoint | yes | |
HTTP agent | ||
URL3 | yes | |
Query fields | yes | |
Timeout | no | |
Request body | yes | |
Headers (names and values) | yes | |
Required status codes | yes | |
HTTP authentication username | yes | |
HTTP authentication password | yes | |
Filters | ||
Regular expression | yes | |
Overrides | ||
Filters: regular expression | yes | |
Operations: update interval (for item prototypes) | no | |
Operations: history storage period (for item prototypes) | no | |
Operations: trend storage period (for item prototypes) | no |
In a network discovery rule, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Update interval | no | |
SNMP v1, v2 | ||
SNMP community | yes | |
SNMP OID | yes | |
SNMP v3 | ||
Context name | yes | |
Security name | yes | |
Authentication passphrase | yes | |
Privacy passphrase | yes | |
SNMP OID | yes |
In a proxy configuration, user macros can be used in the following field:
Location | Multiple macros/mix with text1 | |
---|---|---|
Interface port (for passive proxy) | no |
In a template configuration, user macros can be used in the following fields:
In a trigger configuration, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Name | yes | |
Operational data | yes | |
Expression (only in constants and function parameters; secret macros are not supported) | yes | |
Description | yes | |
URL3 | yes | |
Tag for matching | yes | |
Tags2 | ||
Tag names | yes | |
Tag values | yes |
In a web scenario configuration, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Name | yes | |
Update interval | no | |
Agent | yes | |
HTTP proxy | yes | |
Variables (values only) | yes | |
Headers (names and values) | yes | |
Steps | ||
Name | yes | |
URL3 | yes | |
Variables (values only) | yes | |
Headers (names and values) | yes | |
Timeout | no | |
Required string | yes | |
Required status codes | no | |
Authentication | ||
User | yes | |
Password | yes | |
SSL certificate | yes | |
SSL key file | yes | |
SSL key password | yes | |
Tags2 | ||
Tag names | yes | |
Tag values | yes |
In addition to the locations listed here, user macros can be used in the following fields:
Location | Multiple macros/mix with text1 | |
---|---|---|
Global scripts (script, SSH, Telnet, IPMI), including confirmation text | yes | |
Webhooks | ||
JavaScript script | no | |
JavaScript script parameter name | no | |
JavaScript script parameter value | yes | |
Monitoring → Dashboards | ||
Column of data type Text in Top hosts dashboard widget | yes | |
Description parameter in Item value dashboard widget | yes | |
URL3 parameter in URL dashboard widget | yes | |
Administration → Users → Media | ||
When active | no | |
Administration → General → GUI | ||
Working time | no | |
Administration → Media types → Message templates | ||
Subject | yes | |
Message | yes | |
Administration → Media types → Media type | ||
Username and Password fields for the Email media type (when Authentication is set to "Username and password"; secret macros recommended) | yes |
For a complete list of all macros supported in Zabbix, see supported macros.
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 Macros used in tag names and values are resolved only during event generation process.
3 URLs that contain a secret macro will not work, as the macro in them will be resolved as "******".