Zabbix Documentation 4.0

3.04.05.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.24.4Guidelines

User Tools

Site Tools


manual:config:macros:lld_macros

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:config:macros:lld_macros [2018/08/21 08:03]
martins-v logical reordering
manual:config:macros:lld_macros [2020/03/31 10:42] (current)
marinagen backslash in macro functions in key parameters
Line 3: Line 3:
 === Overview === === Overview ===
  
-There is a type of macro used within the [[manual:​discovery:​low_level_discovery|low-level discovery]] function:+There is a type of macro used within the [[manual:​discovery:​low_level_discovery|low-level discovery]] ​(LLD) function:
  
   {#​MACRO} ​   {#​MACRO} ​
Line 19: Line 19:
 LLD macros can be used: LLD macros can be used:
  
 +  * in the low-level discovery rule filter
   * for item prototypes in   * for item prototypes in
     * names     * names
     * key parameters     * key parameters
     * units     * units
-    * update intervals +    * update intervals<​sup>​[[lld_macros#​footnotes|1]]</​sup>​ 
-    * history storage periods +    * history storage periods<​sup>​[[lld_macros#​footnotes|1]]</​sup>​ 
-    * trend storage periods+    * trend storage periods<​sup>​[[lld_macros#​footnotes|1]]</​sup>​
     * SNMP OIDs     * SNMP OIDs
     * IPMI sensor fields     * IPMI sensor fields
Line 46: Line 47:
       * HTTP agent HTTP SSL key file field       * HTTP agent HTTP SSL key file field
       * HTTP agent HTTP SSL key password field       * HTTP agent HTTP SSL key password field
-      * HTTP agent HTTP timeout field+      * HTTP agent HTTP timeout<​sup>​[[lld_macros#​footnotes|1]]</​sup> ​field
   * for trigger prototypes in   * for trigger prototypes in
     * names     * names
-    * expressions+    * expression (only in constants and function parameters)
     * URLs     * URLs
     * descriptions     * descriptions
Line 65: Line 66:
 === Using macro functions === === Using macro functions ===
  
-Macro functions are supported with low-level discovery macros, allowing to extract a certain part of the macro value using a regular expression.+Macro functions are supported with low-level discovery macros ​(except in low-level discovery rule filter), allowing to extract a certain part of the macro value using a regular expression.
  
-For example, you may want to extract the customer name and interface number from the following LLD macro:+For example, you may want to extract the customer name and interface number from the following LLD macro for the purposes of event tagging:
  
   {#​IFALIAS}=customername_1   {#​IFALIAS}=customername_1
Line 75: Line 76:
 {{:​manual:​config:​macros:​lld_macro_function.png|}} {{:​manual:​config:​macros:​lld_macro_function.png|}}
  
-For more information,​ see: [[:​manual/​config/​macros/​macro_functions|Macro functions]]+Note, that commas are not allowed in unquoted item [[:​manual/​config/​items/​item/​key#​key_parameters|key parameters]],​ so the parameter containing a macro function has to be quoted. The backslash (''​\''​) character should be used to escape double quotes inside the parameter. Example: 
 +  net.if.in["​{{#​IFALIAS}.regsub(\"​(.*)_([0-9]+)\",​ \1)}",​bytes] 
 + 
 + 
 +For more information ​on macro function syntax, see: [[:​manual/​config/​macros/​macro_functions|Macro functions]]
  
 Macro functions are supported in low-level discovery macros since Zabbix 4.0. Macro functions are supported in low-level discovery macros since Zabbix 4.0.
  
 +
 +== Footnotes ==
 +
 +<​sup>​**1**</​sup>​ In the fields marked with <​sup>​[[lld_macros#​footnotes|1]]</​sup>​ a single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.