manual:config:macros:lld_macros

Differences

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

Link to this comparison view

manual:config:macros:lld_macros [2019/01/10 06:18]
martins-v more precise wording
manual:config:macros:lld_macros [2019/10/07 06:35]
Line 1: Line 1:
-==== 3 Low-level discovery macros ==== 
  
-=== Overview === 
- 
-There is a type of macro used within the [[manual:​discovery:​low_level_discovery|low-level discovery]] (LLD) function: 
- 
-  {#​MACRO} ​ 
- 
-It is a macro that is used in an LLD rule and returns real values of file system names, network interfaces, SNMP OIDs, etc. 
- 
-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 //​prototypes//​ in virtual machine [[:​manual/​vm_monitoring#​host_prototypes|discovery]]. 
- 
-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. 
- 
-=== Supported locations === 
- 
-LLD macros can be used: 
- 
-  * in the low-level discovery rule filter 
-  * for item prototypes in 
-    * names 
-    * key parameters 
-    * units 
-    * update intervals 
-    * history storage periods 
-    * trend storage periods 
-    * item value preprocessing steps 
-    * SNMP OIDs 
-    * IPMI sensor fields 
-    * calculated item formulas 
-    * SSH and Telnet scripts 
-    * database monitoring SQL queries 
-    * JMX item endpoint fields 
-    * descriptions 
-    * HTTP agent URL field 
-    * HTTP agent HTTP query fields field 
-    * HTTP agent request body field 
-    * HTTP agent required status codes field 
-    * HTTP agent headers field key and value 
-    * HTTP agent HTTP authentication username field 
-    * HTTP agent HTTP authentication password field 
-    * HTTP agent HTTP proxy field 
-    * HTTP agent HTTP SSL certificate file field 
-    * HTTP agent HTTP SSL key file field 
-    * HTTP agent HTTP SSL key password field 
-    * HTTP agent HTTP timeout field 
-  * for trigger prototypes in 
-    * names 
-    * expression (only in constants and function parameters) 
-    * URLs 
-    * descriptions 
-    * event tag names and values 
-  * for graph prototypes in 
-    * names 
-  * for host prototypes in 
-    * names 
-    * visible names 
-    * host group prototype names 
-    * (see the [[:​manual/​vm_monitoring/​discovery_fields|full list]]) 
- 
-In all those places LLD macros can be used inside user [[:​manual/​config/​macros/​usermacros#​user_macro_context|macro context]]. 
- 
-=== Using macro functions === 
- 
-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 the purposes of event tagging: 
- 
-  {#​IFALIAS}=customername_1 
- 
-To do so, the ''​regsub''​ macro function can be used with the macro in the event tag value field of a trigger prototype: 
- 
-{{:​manual:​config:​macros:​lld_macro_function.png|}} 
- 
-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.