Zabbix Documentation 4.2

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:discovery:low_level_discovery

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:discovery:low_level_discovery [2019/02/19 07:41]
martins-v more precise wording
manual:discovery:low_level_discovery [2019/06/07 07:49] (current)
martins-v lld rule will not go unsupported because of skipping existing entities
Line 57: Line 57:
 ^Parameter^Description^ ^Parameter^Description^
 |//​Name// ​ |Name of discovery rule.  | |//​Name// ​ |Name of discovery rule.  |
-|//​Type// ​ |The type of check to perform discovery; should be //Zabbix agent// or //Zabbix agent (active)// for file system discovery. ​ | +|//​Type// ​ |The type of check to perform discovery; should be //Zabbix agent// or //Zabbix agent (active)// for file system discovery.\\ The discovery rule can also be a [[:​manual/​config/​items/​itemtypes/​dependent_items|dependent item]], depending on a regular item. It cannot depend on another discovery rule. For a dependent item, select the respective type (//​Dependent item//) and specify the master item in the '​Master item' field. The master item must exist.  | 
-|//​Key// ​ |An item with "​vfs.fs.discovery"​ key is built into Zabbix agent since version 2.0 on many platforms (see [[manual:​appendix:​items:​supported_by_platform|supported item key list]] for details), and will return a JSON with the list of file systems present on the computer and their types. ​ |+|//​Key// ​ |An item with "​vfs.fs.discovery"​ key is built into Zabbix agent on many platforms (see [[manual:​appendix:​items:​supported_by_platform|supported item key list]] for details), and will return a JSON with the list of file systems present on the computer and their types. ​ |
 |//Update interval// ​ |This field specifies how often Zabbix performs discovery. In the beginning, when you are just setting up file system discovery, you might wish to set it to a small interval, but once you know it works you can set it to 30 minutes or more, because file systems usually do not change very often.\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 30s, 1m, 2h, 1d, since Zabbix 3.4.0.\\ [[:​manual/​config/​macros/​usermacros|User macros]] are supported, since Zabbix 3.4.0.\\ //Note//: If set to '​0',​ the item will not be polled. However, if a flexible interval also exists with a non-zero value, the item will be polled during the flexible interval duration.\\ ​ //Note// that for an existing discovery rule the discovery can be performed immediately by pushing the //Check now// [[#​form_buttons|button]]. | |//Update interval// ​ |This field specifies how often Zabbix performs discovery. In the beginning, when you are just setting up file system discovery, you might wish to set it to a small interval, but once you know it works you can set it to 30 minutes or more, because file systems usually do not change very often.\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 30s, 1m, 2h, 1d, since Zabbix 3.4.0.\\ [[:​manual/​config/​macros/​usermacros|User macros]] are supported, since Zabbix 3.4.0.\\ //Note//: If set to '​0',​ the item will not be polled. However, if a flexible interval also exists with a non-zero value, the item will be polled during the flexible interval duration.\\ ​ //Note// that for an existing discovery rule the discovery can be performed immediately by pushing the //Check now// [[#​form_buttons|button]]. |
 |//Custom intervals// ​ |You can create custom rules for checking the item:\\ **Flexible** - create an exception to the //Update interval// (interval with different frequency)\\ **Scheduling** - create a custom polling schedule.\\ For detailed information see [[manual:​config:​items:​item:​custom_intervals|Custom intervals]]. Scheduling is supported since Zabix 3.0.0. ​ | |//Custom intervals// ​ |You can create custom rules for checking the item:\\ **Flexible** - create an exception to the //Update interval// (interval with different frequency)\\ **Scheduling** - create a custom polling schedule.\\ For detailed information see [[manual:​config:​items:​item:​custom_intervals|Custom intervals]]. Scheduling is supported since Zabix 3.0.0. ​ |
-|//Keep lost resources period// ​ |This field allows you to specify the duration for how long the discovered entity will be retained (won't be deleted) once its discovery status becomes "Not discovered anymore"​ (min 1 hour, max 25 years).\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 2h, 1d, since Zabbix 3.4.0.\\ [[:​manual/​config/​macros/​usermacros|User macros]] are supported, since Zabbix 3.4.0.\\ //Note:// If set to "​0",​ entities will be deleted immediately. Using "​0"​ is not recommended,​ since just wrongly editing the filter may end up in the entity being deleted with all the historical data.   |+|//Keep lost resources period// ​ |This field allows you to specify the duration for how long the discovered entity will be retained (won't be deleted) once its discovery status becomes ​%%"%%Not discovered anymore%%"%% (between ​1 hour to 25 years; or %%"​%%0%%"​%%).\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 2h, 1d, since Zabbix 3.4.0.\\ [[:​manual/​config/​macros/​usermacros|User macros]] are supported, since Zabbix 3.4.0.\\ //Note:// If set to %%"%%0%%"%%, entities will be deleted immediately. Using %%"%%0%%"%% is not recommended,​ since just wrongly editing the filter may end up in the entity being deleted with all the historical data.   |
 |//​Description// ​ |Enter a description. ​ | |//​Description// ​ |Enter a description. ​ |
 |//​Enabled// ​ |If checked, the rule will be processed. ​ | |//​Enabled// ​ |If checked, the rule will be processed. ​ |
Line 80: Line 80:
 |   ​|//​JSONPath// ​ |Path that is used to extract LLD macro value from a LLD row, using JSONPath syntax.\\ For example, ''​$.foo''​ will extract %%"​%%bar%%"​%% and %%"​%%baz%%"​%% from this JSON: ''​[{%%"​%%foo%%"​%%:​%%"​%%bar%%"​%%},​ {%%"​%%foo%%"​%%:​%%"​%%baz%%"​%%}]''​\\ JSONPath can be specified using the dot notation or the bracket notation. Bracket notation should be used in case of any special characters and Unicode, like ''​$['​unicode + special chars #​1'​]['​unicode + special chars #​2'​]''​.\\ If you mark the //Custom on fail// checkbox, it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ | |   ​|//​JSONPath// ​ |Path that is used to extract LLD macro value from a LLD row, using JSONPath syntax.\\ For example, ''​$.foo''​ will extract %%"​%%bar%%"​%% and %%"​%%baz%%"​%% from this JSON: ''​[{%%"​%%foo%%"​%%:​%%"​%%bar%%"​%%},​ {%%"​%%foo%%"​%%:​%%"​%%baz%%"​%%}]''​\\ JSONPath can be specified using the dot notation or the bracket notation. Bracket notation should be used in case of any special characters and Unicode, like ''​$['​unicode + special chars #​1'​]['​unicode + special chars #​2'​]''​.\\ If you mark the //Custom on fail// checkbox, it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |
 ^Custom scripts ​ ^^^ ^Custom scripts ​ ^^^
-|   |//Javascript//  |Enter JavaScript code in the block that appears when clicking in the parameter field or on //​Open//​. ​ |+|   |//JavaScript//  |Enter JavaScript code in the block that appears when clicking in the parameter field or on //Open//.\\ Note that available JavaScript length depends on the [[:​manual/​config/​items/​item#​custom_script_limit|database used]].  |
 ^Validation ​ ^^^ ^Validation ​ ^^^
 |   ​|//​Does not match regular expression// ​ |Specify a regular expression that a value must not match.\\ E.g. ''​%%Error:​(.*?​)\.%%''​\\ If you mark the //Custom on fail// checkbox, it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ | |   ​|//​Does not match regular expression// ​ |Specify a regular expression that a value must not match.\\ E.g. ''​%%Error:​(.*?​)\.%%''​\\ If you mark the //Custom on fail// checkbox, it is possible to specify custom error handling options: either to discard the value, set a specified value or set a specified error message. ​ |
Line 86: Line 86:
 ^Throttling ​ ^^^ ^Throttling ​ ^^^
 |   ​|//​Discard unchanged with heartbeat// ​ |Discard a value if it has not changed within the defined time period (in seconds).\\ Positive integer values are supported to specify the seconds (minimum - 1 second). Time suffixes can be used in this field (e.g. 30s, 1m, 2h, 1d). User macros and low-level discovery macros can be used in this field.\\ Only one throttling option can be specified for a discovery item.\\ E.g. ''​1m''​. If identical text is passed into this rule twice within 60 seconds, it will be discarded.\\ //Note//: Changing item prototypes does not reset throttling. Throttling is reset only when preprocessing steps are changed. ​ | |   ​|//​Discard unchanged with heartbeat// ​ |Discard a value if it has not changed within the defined time period (in seconds).\\ Positive integer values are supported to specify the seconds (minimum - 1 second). Time suffixes can be used in this field (e.g. 30s, 1m, 2h, 1d). User macros and low-level discovery macros can be used in this field.\\ Only one throttling option can be specified for a discovery item.\\ E.g. ''​1m''​. If identical text is passed into this rule twice within 60 seconds, it will be discarded.\\ //Note//: Changing item prototypes does not reset throttling. Throttling is reset only when preprocessing steps are changed. ​ |
 +^Prometheus ​ ^^^
 +|   ​|//​Prometheus to JSON// ​ |Convert required Prometheus metrics to JSON.\\ See [[:​manual/​config/​items/​itemtypes/​prometheus|Prometheus checks]] for more details. ​ |
  
 Note that if the discovery rule has been applied to the host via template then the content of this tab is read-only. Note that if the discovery rule has been applied to the host via template then the content of this tab is read-only.
Line 131: Line 133:
 {{manual:​discovery:​low_level_discovery:​item_prototype_fs1.png|}} {{manual:​discovery:​low_level_discovery:​item_prototype_fs1.png|}}
  
-Low-level discovery [[:​manual/​config/​macros/​lld_macros|macros]] and user [[:​manual/​appendix/​macros/​supported_by_location_user|macros]] may be used in item prototype configuration and item value preprocessing [[:​manual/​config/​items/​item#​item_value_preprocessing|parameters]].+Low-level discovery [[:​manual/​config/​macros/​lld_macros|macros]] and user [[:​manual/​appendix/​macros/​supported_by_location_user|macros]] may be used in item prototype configuration and item value preprocessing [[:​manual/​config/​items/​item#​item_value_preprocessing|parameters]]. Note that when used in update intervals, a single macro has to fill the whole field. Multiple macros in one field or macros mixed with text are not supported.
  
 <​note>​Context-specific escaping of low-level discovery macros is performed for safe use in regular expression and XPath preprocessing parameters.</​note>​ <​note>​Context-specific escaping of low-level discovery macros is performed for safe use in regular expression and XPath preprocessing parameters.</​note>​
Line 185: Line 187:
 {{manual:​discovery:​low_level_discovery:​discovered_items1.png|}} {{manual:​discovery:​low_level_discovery:​discovered_items1.png|}}
  
-Note that discovered entities will not be created in case there are already existing entities with the same uniqueness criteria, for example, an item with the same key or graph with the same name. An error message is displayed in this case that the low-level discovery rule could not create certain entities.+Note that discovered entities will not be created in case there are already existing entities with the same uniqueness criteria, for example, an item with the same key or graph with the same name. An error message is displayed in this case in the frontend ​that the low-level discovery rule could not create certain ​entities. The discovery rule itself, however, will not turn unsupported because some entity could not be created and had to be skipped. The discovery rule will go on creating/​updating other entities.
  
 Items (similarly, triggers and graphs) created by a low-level discovery rule will be deleted automatically if a discovered entity (file system, interface, etc) stops being discovered (or does not pass the filter anymore). In this case the items, triggers and graphs will be deleted after the days defined in the //Keep lost resources period// field pass. Items (similarly, triggers and graphs) created by a low-level discovery rule will be deleted automatically if a discovered entity (file system, interface, etc) stops being discovered (or does not pass the filter anymore). In this case the items, triggers and graphs will be deleted after the days defined in the //Keep lost resources period// field pass.