Zabbix Documentation 2.4

3.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.22.43.23.4

User Tools

Site Tools


manual:appendix:macros:supported_by_location

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:macros:supported_by_location [2015/01/30 07:17]
martins-v trying to clarify simple macro description
manual:appendix:macros:supported_by_location [2019/01/18 08:33] (current)
martins-v fixing some formatting issues
Line 1: Line 1:
-==== - #1 Macros supported by location ====+==== 1 Macros supported by location ====
  
 === Overview === === Overview ===
Line 6: Line 6:
  
   * **X** means "​supported"​ in that location   * **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.+  * 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. Additionally {HOST.HOST**<​1-9>​**} is supported within {host:​key.func(param)} macro in graph names. For example, %%{{%%HOST.HOST2}:​key.func()} in the graph name will refer to the host of the second item in the graph.
  
 |                                                                       URL field of dynamic URL **screen** element|||||||||||||||||||▼^ ​ ▼DESCRIPTION▼ ​ | |                                                                       URL field of dynamic URL **screen** element|||||||||||||||||||▼^ ​ ▼DESCRIPTION▼ ​ |
Line 18: Line 18:
 |                                                                          Trigger **expressions**|||||||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​| |                                                                          Trigger **expressions**|||||||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|
 |                                                                                 Map **URLs**|||||||||^▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​| |                                                                                 Map **URLs**|||||||||^▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|
- ​Map ​**labels<​sup>​[[supported_by_location#​footnotes|1]]</​sup>​**|||||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|+                   ​Icon ​**labels** in maps**<​sup>​[[supported_by_location#​footnotes|1]]</​sup>​**|||||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|
 |                                                                Item key **parameters**|||||||^▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​| |                                                                Item key **parameters**|||||||^▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|
 |                                       ​Global **scripts** including confirmation text|||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​| |                                       ​Global **scripts** including confirmation text|||||||▼|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|:::​|
Line 143: Line 143:
 |{ITEM.KEY<​1-9>​} ​                       | X |   ​| ​  | X | X | 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<​1-9>​} ​                       | X |   ​| ​  | X | X | 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 |   ​| ​  | X | X | 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.KEY.ORIG<​1-9>​} ​                  | X |   ​| ​  | X | X | 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()}''​|+|{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()}''​|
 |{ITEM.LOG.AGE<​1-9>​} ​                   | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Age of the log item event.// ​ | |{ITEM.LOG.AGE<​1-9>​} ​                   | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Age of the log item event.// ​ |
 |{ITEM.LOG.DATE<​1-9>​} ​                  | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Date of the log item event.// ​  | |{ITEM.LOG.DATE<​1-9>​} ​                  | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Date of the log item event.// ​  |
Line 172: Line 172:
 |{TRIGGER.EVENTS.PROBLEM.UNACK} ​        | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Number of unacknowledged 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.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.HOSTGROUP.NAME} ​              | X |   ​| ​  | X |   ​| ​  ​| ​  ​| ​  ​| ​|   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  |//A sorted (by SQL query), comma-space separated list of host groups in which the trigger is defined.// Supported since 2.0.6.|+|{TRIGGER.HOSTGROUP.NAME} ​              | X |   ​| ​  | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​|   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  |//A sorted (by SQL query), comma-space separated list of host groups in which the trigger is defined.// Supported since 2.0.6.|
 ^                                       ​| ​ 1  ^  2  |  3  ^  4  |  5  ^  6  |  7  ^  8  |  9  ^  10  |  11  ^  12  |  13  ^  14  |  15  ^  16  |  17  ^  18  |  19  ^ | ^                                       ​| ​ 1  ^  2  |  3  ^  4  |  5  ^  6  |  7  ^  8  |  9  ^  10  |  11  ^  12  |  13  ^  14  |  15  ^  16  |  17  ^  18  |  19  ^ |
 |{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.ACK} ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  | X |   ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​| ​  ​|//​Number of acknowledged PROBLEM events for triggers in PROBLEM state.// Supported since 1.8.3.|
Line 198: Line 198:
 <​sup>​**1**</​sup>​ Macros for map labels are supported since 1.8. <​sup>​**1**</​sup>​ Macros for map labels are supported since 1.8.
  
-<​sup>​**2**</​sup> ​Since Zabbix 2.0.3, the HOST.* macros supported in item key parameters will only work in item types that have interfaces, i.e. they will not work for types "​Zabbix agent (active)",​ "​Calculated"​ etc.+<​sup>​**2**</​sup> ​The ''​{HOST.*}'' ​macros supported in item key parameters will resolve to the interface ​that is selected for the itemThey will not resolve when used in items without interfaces e.g. "​Zabbix agent (active)",​ "​Calculated"​ etc.
  
-<​sup>​**3**</​sup> ​Depending on the context, the macro will be expanded differently. ​In **2.0.1** or earlier versions, in the context of remote ​command executionGUI 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** ​and for web scenarios ​since **2.2.0** ​the macro will use the main agent interface, however, if it is not present, the main SNMP interface will be used. If SNMP is also not present, the main JMX interface will be used. If JMX is not present either, the 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.+<​sup>​**3**</​sup>​ In remote ​commandsglobal ​scripts, interface IP/DNS fields and web scenarios the macro will resolve to the main agent interface, however, if it is not present, the main SNMP interface will be used. If SNMP is also not present, the main JMX interface will be used. If JMX is not present either, the main IPMI interface will be used.
  
-<​sup>​**4**</​sup>​ Only the **avg**, **last**, **max** and **min** functions, with seconds as parameter are supported in this macro in map labels.+<​sup>​**4**</​sup> ​This macro is supported in icon labels and link labels in maps. Only the **avg**, **last**, **max** and **min** functions, with seconds as parameter are supported in this macro.
  
 <​sup>​**5**</​sup>​ Supported since 2.0.3. <​sup>​**5**</​sup>​ Supported since 2.0.3.
Line 210: Line 210:
 <​sup>​**7**</​sup>​ Supported since Zabbix 2.2.0. Only the **avg**, **last**, **max** and **min** functions, with seconds as parameter are supported within this macro in graph names. The {HOST.HOST<​1-9>​} macro can be used as host within the macro. For example: <​sup>​**7**</​sup>​ Supported since Zabbix 2.2.0. Only the **avg**, **last**, **max** and **min** functions, with seconds as parameter are supported within this macro in graph names. The {HOST.HOST<​1-9>​} macro can be used as host within the macro. For example:
    * {Cisco switch:​ifAlias[{#​SNMPINDEX}].last()}    * {Cisco switch:​ifAlias[{#​SNMPINDEX}].last()}
-   * {{HOST.HOST}:​ifAlias[{#​SNMPINDEX}].last()}+   ​* ​%%{{%%HOST.HOST}:​ifAlias[{#​SNMPINDEX}].last()}
  
 <​sup>​**8**</​sup>​ Supported since 2.4.0. <​sup>​**8**</​sup>​ Supported since 2.4.0.
Line 229: Line 229:
     * Interface port     * Interface port
  
-  * Items+  * Items and item prototypes 
 +    * SNMPv3 context name
     * SNMPv3 security name     * SNMPv3 security name
     * SNMPv3 auth pass     * SNMPv3 auth pass
Line 246: Line 247:
  
   * Discovery   * Discovery
 +      * SNMPv3 context name
       * SNMPv3 security name       * SNMPv3 security name
       * SNMPv3 auth pass       * SNMPv3 auth pass
Line 257: Line 259:
  
 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. 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.
 +
 +These macros are also used in creating host and host group [[:​manual/​vm_monitoring#​host_prototypes|prototypes]] in virtual machine discovery.
  
 LLD macros can be used: LLD macros can be used:
Line 266: Line 270:
     * calculated item formulas     * calculated item formulas
     * SSH and Telnet scripts     * SSH and Telnet scripts
-    * database ​monitor item parameters+    * database ​monitoring SQL queries 
 +    * descriptions (supported since 2.2.0)
   * for trigger prototypes in   * for trigger prototypes in
     * names     * names
     * expressions (insofar as when referencing an item key prototype and as standalone constants)     * expressions (insofar as when referencing an item key prototype and as standalone constants)
 +    * descriptions (supported since 2.2.0)
   * for graph prototypes in   * for graph prototypes in
     * names     * names
 +  * for host prototypes (supported since 2.2.0) in
 +    * names
 +    * visible names
 +    * host group prototype names
 +    * (see the [[:​manual/​vm_monitoring/​discovery_fields|full list]])
  
-Some low-level discovery macros come "​pre-packaged"​ with the LLD funtion ​in Zabbix - {#FSNAME}, {#FSTYPE}, {#IFNAME}, {#​SNMPINDEX},​ {#​SNMPVALUE}. However, adhering to these names is not compulsory when creating a [[manual:​discovery:​low_level_discovery#​creating_custom_lld_rules|custom]] low-level discovery rule. Then you may use any other LLD macro name and refer to that name.+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 [[manual:​discovery:​low_level_discovery#​creating_custom_lld_rules|custom]] low-level discovery rule. Then you may use any other LLD macro name and refer to that name.