This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

1 Macros supported by location

Overview

The table contains a complete list of macros supported by Zabbix:

  • X means "supported" in that location
  • The numbered macro syntax of {MACRO<1-9>} is used to reference hosts in the order in which they appear in a trigger expression. Thus, macros like {HOST.IP1}, {HOST.IP2}, {HOST.IP3} will expand to the IP of the first, second and third host in the trigger expression, providing the expression contains those hosts.
DB monitor additional parameters, SSH and Telnet scripts ▼DESCRIPTION▼
Interface IP/DNS
Item names
Trigger names
Trigger expressions
Map URLs
Icon labels in maps1
Item key parameters
Global scripts
Auto registration notifications
Discovery notifications
Notifications and commands
▼MACRO▼ 1 2 3 4 5 6 7 8 9 10 11 12
{DATE} X X X Current date in yyyy.mm.dd. format.
{DISCOVERY.DEVICE.IPADDRESS} X IP address of the discovered device. Available always, does not depend on host being added.
{DISCOVERY.DEVICE.DNS} X DNS name of the discovered device. Available always, does not depend on host being added.
{DISCOVERY.DEVICE.STATUS} X Status of the discovered device: can be either UP or DOWN.
{DISCOVERY.DEVICE.UPTIME} X Time since the last change of discovery status for a particular device.
For example: 1h 29m.
For devices with status DOWN, this is the period of their downtime.
{DISCOVERY.RULE.NAME} X Name of the discovery rule that discovered the presence or absence of the device or service.
{DISCOVERY.SERVICE.NAME} X Name of the service that was discovered.
For example: HTTP.
{DISCOVERY.SERVICE.PORT} X Port of the service that was discovered.
For example: 80.
{DISCOVERY.SERVICE.STATUS} X Status of the discovered service: can be either UP or DOWN.
{DISCOVERY.SERVICE.UPTIME} X Time since the last change of discovery status for a particular service.
For example: 1h 29m.
For services with status DOWN, this is the period of their downtime.
{ESC.HISTORY} X Escalation history. Log of previously sent messages. Shows previously sent notifications, on which escalation step they were sent and their status (sent, in progress or failed).
{EVENT.ACK.HISTORY} X
{EVENT.ACK.STATUS} X
{EVENT.AGE} X X X Age of the event. Useful in escalated messages.
{EVENT.DATE} X X X Date of the event.
{EVENT.ID} X X X Numeric event ID which triggered this action.
{EVENT.TIME} X X X Time of the event.
{HOST.CONN<1-9>} X X X2 X X X X5 IP or host DNS name depending on host settings3. Supported in trigger names since 2.0.0.
{HOST.DNS<1-9>} X X X2 X X X X5 Host DNS name3. Supported in trigger names since 2.0.0.
{HOST.HOST<1-9>} X X X X X X X X5 Host name. {HOSTNAME<1-9>} is deprecated.
{HOST.ID} X Host ID.
{HOST.IP<1-9>} X X X X2 X X X X5 Host IP address3. Supported since 2.0.0. {IPADDRESS<1-9>} is deprecated.
{HOST.NAME<1-9>} X X X X X X X5 Visible host name. Supported since 2.0.0.
{HOST.PORT} X Host (agent) port3. Supported since 2.0.0.
{HOSTGROUP.ID} X Host group ID.
1 2 3 4 5 6 7 8 9 10 11 12
{INVENTORY.ALIAS<1-9>} X Alias field in host inventory.
{INVENTORY.ASSET.TAG<1-9>} X Asset tag field in host inventory.
{INVENTORY.CHASSIS<1-9>} X Chassis field in host inventory.
{INVENTORY.CONTACT<1-9>} X Contact field in host inventory. {PROFILE.CONTACT<1-9>} is deprecated.
{INVENTORY.CONTRACT.NUMBER<1-9>} X Contract number field in host inventory.
{INVENTORY.DEPLOYMENT.STATUS<1-9>} X Deployment status field in host inventory.
{INVENTORY.HARDWARE<1-9>} X Hardware field in host inventory. {PROFILE.HARDWARE<1-9>} is deprecated.
{INVENTORY.HARDWARE.FULL<1-9>} X Hardware (Full details) field in host inventory.
{INVENTORY.HOST.NETMASK<1-9>} X Host subnet mask field in host inventory.
{INVENTORY.HOST.NETWORKS<1-9>} X Host networks field in host inventory.
{INVENTORY.HOST.ROUTER<1-9>} X Host router field in host inventory.
{INVENTORY.HW.ARCH<1-9>} X Hardware architecture field in host inventory.
{INVENTORY.HW.DATE.DECOMM<1-9>} X Date hardware decommissioned field in host inventory.
{INVENTORY.HW.DATE.EXPIRY<1-9>} X Date hardware maintenance expires field in host inventory.
{INVENTORY.HW.DATE.INSTALL<1-9>} X Date hardware installed field in host inventory.
{INVENTORY.HW.DATE.PURCHASE<1-9>} X Date hardware purchased field in host inventory.
{INVENTORY.INSTALLER.NAME<1-9>} X Installer name field in host inventory.
{INVENTORY.LOCATION<1-9>} X Location field in host inventory. {PROFILE.LOCATION<1-9>} is deprecated.
{INVENTORY.LOCATION.LAT<1-9>} X Location latitude field in host inventory.
{INVENTORY.LOCATION.LON<1-9>} X Location longitude field in host inventory.
1 2 3 4 5 6 7 8 9 10 11 12
{INVENTORY.MACADDRESS.A<1-9>} X MAC address A field in host inventory. {PROFILE.MACADDRESS<1-9>} is deprecated.
{INVENTORY.MACADDRESS.B<1-9>} X MAC address B field in host inventory.
{INVENTORY.MODEL<1-9>} X Model field in host inventory.
{INVENTORY.NAME<1-9>} X Name field in host inventory. {PROFILE.NAME<1-9>} is deprecated.
{INVENTORY.NOTES<1-9>} X Notes field in host inventory. {PROFILE.NOTES<1-9>} is deprecated.
{INVENTORY.OOB.IP<1-9>} X OOB IP address field in host inventory.
{INVENTORY.OOB.NETMASK<1-9>} X OOB subnet mask field in host inventory.
{INVENTORY.OOB.ROUTER<1-9>} X OOB router field in host inventory.
{INVENTORY.OS<1-9>} X OS field in host inventory. {PROFILE.OS<1-9>} is deprecated.
{INVENTORY.OS.FULL<1-9>} X OS (Full details) field in host inventory.
{INVENTORY.OS.SHORT<1-9>} X OS (Short) field in host inventory.
{INVENTORY.POC.PRIMARY.CELL<1-9>} X Primary POC cell field in host inventory.
{INVENTORY.POC.PRIMARY.EMAIL<1-9>} X Primary POC email field in host inventory.
{INVENTORY.POC.PRIMARY.NAME<1-9>} X Primary POC name field in host inventory.
{INVENTORY.POC.PRIMARY.NOTES<1-9>} X Primary POC notes field in host inventory.
{INVENTORY.POC.PRIMARY.PHONE.A<1-9>} X Primary POC phone A field in host inventory.
{INVENTORY.POC.PRIMARY.PHONE.B<1-9>} X Primary POC phone B field in host inventory.
{INVENTORY.POC.PRIMARY.SCREEN<1-9>} X Primary POC screen name field in host inventory.
{INVENTORY.POC.SECONDARY.CELL<1-9>} X Secondary POC cell field in host inventory.
{INVENTORY.POC.SECONDARY.EMAIL<1-9>} X Secondary POC email field in host inventory.
1 2 3 4 5 6 7 8 9 10 11 12
{INVENTORY.POC.SECONDARY.NAME<1-9>} X Secondary POC name field in host inventory.
{INVENTORY.POC.SECONDARY.NOTES<1-9>} X Secondary POC notes field in host inventory.
{INVENTORY.POC.SECONDARY.PHONE.A<1-9>} X Secondary POC phone A field in host inventory.
{INVENTORY.POC.SECONDARY.PHONE.B<1-9>} X Secondary POC phone B field in host inventory.
{INVENTORY.POC.SECONDARY.SCREEN<1-9>} X Secondary POC screen name field in host inventory.
{INVENTORY.SERIALNO.A<1-9>} X Serial number A field in host inventory. {PROFILE.SERIALNO<1-9>} is deprecated.
{INVENTORY.SERIALNO.B<1-9>} X Serial number B field in host inventory.
{INVENTORY.SITE.ADDRESS.A<1-9>} X Site address A field in host inventory.
{INVENTORY.SITE.ADDRESS.B<1-9>} X Site address B field in host inventory.
{INVENTORY.SITE.ADDRESS.C<1-9>} X Site address C field in host inventory.
{INVENTORY.SITE.CITY<1-9>} X Site city field in host inventory.
{INVENTORY.SITE.COUNTRY<1-9>} X Site country field in host inventory.
{INVENTORY.SITE.NOTES<1-9>} X Site notes field in host inventory.
{INVENTORY.SITE.RACK<1-9>} X Site rack location field in host inventory.
{INVENTORY.SITE.STATE<1-9>} X Site state / province field in host inventory.
{INVENTORY.SITE.ZIP<1-9>} X Site ZIP / postal field in host inventory.
{INVENTORY.SOFTWARE<1-9>} X Software field in host inventory. {PROFILE.SOFTWARE<1-9>} is deprecated.
{INVENTORY.SOFTWARE.APP.A<1-9>} X Software application A field in host inventory.
{INVENTORY.SOFTWARE.APP.B<1-9>} X Software application B field in host inventory.
{INVENTORY.SOFTWARE.APP.C<1-9>} X Software application C field in host inventory.
1 2 3 4 5 6 7 8 9 10 11 12
{INVENTORY.SOFTWARE.APP.D<1-9>} X Software application D field in host inventory.
{INVENTORY.SOFTWARE.APP.E<1-9>} X Software application E field in host inventory.
{INVENTORY.SOFTWARE.FULL<1-9>} X Software (Full details) field in host inventory.
{INVENTORY.TAG<1-9>} X Tag field in host inventory. {PROFILE.TAG<1-9>} is deprecated.
{INVENTORY.TYPE<1-9>} X Type field in host inventory. {PROFILE.DEVICETYPE<1-9>} is deprecated.
{INVENTORY.TYPE.FULL<1-9>} X Type (Full details) field in host inventory.
{INVENTORY.URL.A<1-9>} X URL A field in host inventory.
{INVENTORY.URL.B<1-9>} X URL B field in host inventory.
{INVENTORY.URL.C<1-9>} X URL C field in host inventory.
{INVENTORY.VENDOR<1-9>} X Vendor field in host inventory.
1 2 3 4 5 6 7 8 9 10 11 12
{ITEM.ID<1-9>} X Numeric ID of the Nth item in the trigger expression that caused a notification. Supported since 1.8.12.
{ITEM.DESCRIPTION<1-9>} X Description of the Nth item in the trigger expression that caused a notification. Supported since 2.0.0.
{ITEM.KEY<1-9>} X Key of the Nth item in the trigger expression that caused a notification. Supported since 2.0.0. {TRIGGER.KEY} is deprecated.
{ITEM.KEY.ORIG<1-9>} X Original key (with macros not expanded) of the Nth item in the trigger expression that caused a notification. Supported since 2.0.6.
{ITEM.LASTVALUE<1-9>} X X The latest value of the Nth item in the trigger expression that caused a notification. Supported since 1.4.3. It is alias to {{HOST.HOST}:{ITEM.KEY}.last(0)}
{ITEM.LOG.AGE<1-9>} X
{ITEM.LOG.DATE<1-9>} X
{ITEM.LOG.EVENTID<1-9>} X
{ITEM.LOG.NSEVERITY<1-9>} X
{ITEM.LOG.SEVERITY<1-9>} X
{ITEM.LOG.SOURCE<1-9>} X
{ITEM.LOG.TIME<1-9>} X
{ITEM.NAME<1-9>} X Name of the Nth item in the trigger expression that caused a notification.
{ITEM.NAME.ORIG<1-9>} X Original name (with macros not expanded) of the Nth item in the trigger expression that caused a notification. Supported since 2.0.6.
{ITEM.VALUE<1-9>} X X Resolved to either:
1) the latest value of the Nth item in the trigger expression, if used for displaying triggers. In this case, works the same as {ITEM.LASTVALUE}.
2) the historical (at-the-time-of-event) value of the Nth item in the trigger expression, if used for displaying events and notifications.
In both cases it will resolve to UNKNOWN if the history value has already been deleted or has never been stored.
Supported since 1.4.3.
{MAP.ID} X Network map ID.
{NODE.ID<1-9>} X X X
{NODE.NAME<1-9>} X X X
1 2 3 4 5 6 7 8 9 10 11 12
{PROXY.NAME<1-9>} X X X Proxy name of the Nth item in the trigger expression that caused a notification. Supported since 1.8.4.
{TIME} X X X Current time in hh:mm:ss.
{TRIGGER.DESCRIPTION} X Trigger description. Supported since 2.0.4. {TRIGGER.COMMENT} is deprecated.
{TRIGGER.EVENTS.ACK} X X Number of acknowledged events for a map element in maps, or for the trigger which generated current event in notifications. Supported since 1.8.3.
{TRIGGER.EVENTS.PROBLEM.ACK} X X Number of acknowledged PROBLEM events for all triggers disregarding their state. Supported since 1.8.3.
{TRIGGER.EVENTS.PROBLEM.UNACK} X X Number of unacknowledged PROBLEM events for all triggers disregarding their state. Supported since 1.8.3.
{TRIGGER.EVENTS.UNACK} X X Number of unacknowledged events for a map element in maps, or for the trigger which generated current event in notifications. Supported in map element labels since 1.8.3.
{TRIGGER.PROBLEM.EVENTS.PROBLEM.ACK} X Number of acknowledged PROBLEM events for triggers in PROBLEM state. Supported since 1.8.3.
{TRIGGER.PROBLEM.EVENTS.PROBLEM.UNACK} X Number of unacknowledged PROBLEM events for triggers in PROBLEM state. Supported since 1.8.3.
1 2 3 4 5 6 7 8 9 10 11 12
{TRIGGER.EXPRESSION} X Trigger expression. Supported since 1.8.12.
{TRIGGER.HOSTGROUP.NAME} X Sorted (by SQL query) comma-space separated list of host groups in which the trigger is defined. Supported since 2.0.6.
{TRIGGER.ID} X X Numeric trigger ID which triggered this action.
{TRIGGER.NAME} X Name of the trigger.
{TRIGGER.NAME.ORIG} X Original name (with macros not expanded) of the trigger. Supported since 2.0.6.
{TRIGGER.NSEVERITY} X Numerical trigger severity. Possible values: 0 - Not classified, 1 - Information, 2 - Warning, 3 - Average, 4 - High, 5 - Disaster. Supported starting from Zabbix 1.6.2.
{TRIGGER.SEVERITY} X Trigger severity name. Can be defined in Administration → General → Trigger severities.
{TRIGGER.STATUS} X Trigger state. Can be either PROBLEM or OK. {STATUS} is deprecated.
{TRIGGER.TEMPLATE.NAME} X Sorted (by SQL query) comma-space separated list of templates in which the trigger is defined or *UNKNOWN* if the trigger is defined in a host. Supported since 2.0.6.
{TRIGGER.URL} X Trigger URL.
{TRIGGER.VALUE} X X Current trigger value: 0 - trigger is in OK state, 1 - trigger is in PROBLEM state, 2 - trigger UNKNOWN. This macro can also be used in trigger expressions.
{TRIGGERS.UNACK} X Number of unacknowledged triggers for a map element, disregarding trigger state. Trigger is considered to be unacknowledged if at least one of its PROBLEM events is unacknowledged.
{TRIGGERS.PROBLEM.UNACK} X Number of unacknowledged PROBLEM triggers for a map element. Trigger is considered to be unacknowledged if at least one of its PROBLEM events is unacknowledged. Supported since 1.8.3.
{TRIGGERS.ACK} X Number of acknowledged triggers for a map element, disregarding trigger state. Trigger is considered to be acknowledged if all of it's PROBLEM events are acknowledged. Supported since 1.8.3.
{TRIGGERS.PROBLEM.ACK} X Number of acknowledged PROBLEM triggers for a map element. Trigger is considered to be acknowledged if all of it's PROBLEM events are acknowledged. Supported since 1.8.3.
{host:key.func(param)} X X4 X7 Simple macros as used in building trigger expressions.
{$MACRO} X X6 X X X X User macros. Supported in item and trigger names since 1.8.4.
1 2 3 4 5 6 7 8 9 10 11 12

[1] Macros for map labels are supported since 1.8.

[2] Since 2.0.3 HOST.* macros supported in item keys will only work for item types that have interfaces. E. g. they will not work for types "Zabbix agent (active)", "Calculated" etc.

[3] Depending on the context, the macro will be expanded differently.

In 2.0.1 or earlier version in the context of remote command execution, GUI scripts, item key parameters, and interface IP/DNS fields only the main agent interface will be considered as the source of information.

Since 2.0.2 the macro will use the main agent interface, however, if it is not present, main SNMP interface will be used. If SNMP is also not present, main JMX interface will be used. If JMX is not present either, main IPMI interface will be used.

In item key parameters the interface that is selected for the item will be used, since 2.0.3.

[4] This macro is supported in icon labels and link labels in maps. Only functions last, avg, max and min with seconds as arguments are supported in this macro.

[5] Supported since 2.0.3.

[6] Only in trigger expression constants and function parameters.

[7] While supported to build trigger expressions, simple macros may not be used inside each other.

Macro {TRIGGER.ID} is supported in trigger URL since Zabbix 1.8.8.

Additional support for user macros

In addition to the locations listed, user definable macros since Zabbix 2.0 are supported in numerous other locations.

  • Hosts
    • Interface IP/DNS
    • Interface port
  • Passive proxy
    • Interface port
  • Items
    • SNMPv3 security name
    • SNMPv3 auth pass
    • SNMPv3 priv pass
    • SNMPv1/v2 community
    • SNMP OID
    • SNMP port
    • DB monitor additional parameters
    • SSH username
    • SSH public key
    • SSH private key
    • SSH password
    • SSH script
    • Telnet username
    • Telnet password
    • Telnet script
    • Calculated item formula
  • Discovery
    * SNMPv3 security name
           * SNMPv3 auth pass
           * SNMPv3 priv pass
           * SNMPv1/v2 community
           * SNMP OID

Macros used in low-level discovery

There is a type of macro used within the low-level discovery function - {#MACRO}. It is a macro that is used in an LLD rule and returns real values of file system names, network interfaces and SNMP OIDs.

These macros can be used for creating item, trigger and graph prototypes. Then, when discovering real file systems, network interfaces etc., these macros are substituted with real values and are the basis for creating real items, triggers and graphs.

LLD macros can be used:

  • for item prototypes in
    • names
    • key parameters
    • SNMP OIDs
    • calculated item formulas
    • SSH and Telnet scripts
    • database monitoring SQL queries
  • for trigger prototypes in
    • names
    • expressions (insofar as when referencing an item key prototype)
  • for graph prototypes in
    • names

Some low-level discovery macros come "pre-packaged" with the LLD function in Zabbix - {#FSNAME}, {#FSTYPE}, {#IFNAME}, {#SNMPINDEX}, {#SNMPVALUE}. However, adhering to these names is not compulsory when creating a custom low-level discovery rule. Then you may use any other LLD macro name and refer to that name.