[ZBXNEXT-4087] Allow preprocessing in LLD rules Created: 2017 Sep 06 Updated: 2024 Apr 10 Resolved: 2019 Apr 12 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 4.0.0alpha1 |
Fix Version/s: | 4.2.0beta1, 4.2 (plan) |
Type: | New Feature Request | Priority: | Major |
Reporter: | Glebs Ivanovskis (Inactive) | Assignee: | Andris Zeila |
Resolution: | Fixed | Votes: | 25 |
Labels: | lld, preprocessing | ||
Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
Attachments: | ACC - Support preprocessing for LLD rules - v1.1 .pdf Preprocessing for LLD 1.0rc1.pdf Preprocessing for LLD 1.0rc3.pdf zbx_export_hosts_2_log.xml | ||||||||||||||||||||||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
Sub-Tasks: |
|
||||||||||||||||||||||||||||||||||||||||
Team: | Team A | ||||||||||||||||||||||||||||||||||||||||
Sprint: | Sprint 46, Nov 2018, Sprint 47, Dec 2018, Sprint 48, Jan 2019, Sprint 49 (Feb 2019), Sprint 50 (Mar 2019), Sprint 51 (Apr 2019) | ||||||||||||||||||||||||||||||||||||||||
Story Points: | 5 |
Description |
Maybe it's a duplicate, but I failed to find original issue. The request is quite obvious and "in the air" after |
Comments |
Comment by Marc [ 2018 Aug 15 ] |
Maybe it's a duplicate, but I failed to find original issue. |
Comment by Alexei Vladishev [ 2018 Aug 20 ] |
Hey all! Please have a look at the attached acceptance criteria document that covers proposed functionality. It has all chances to be implemented in Zabbix 4.2. Let me know what you think. Is there anything to improve? I appreciate any feedback. |
Comment by Jan Garaj [ 2018 Aug 20 ] |
Hey Alex, I would like to use this functionality for containers discovery. Related questions:
|
Comment by Alexei Vladishev [ 2018 Aug 21 ] |
Same logic as we have now for LLD macros. If a key not found the macro will stay as it it, i.e. will not be substituted.
Not yet. It may come in the future. |
Comment by Glebs Ivanovskis [ 2018 Sep 06 ] |
So the plan is to convert every imaginable source of data for low-level discovery into JSON with a specific preprocessing step? It is relatively for CSV, but I'm not sure it is the best approach in the long-term. First of all, JSON capabilities are limited. Imagine I have XML I want to use for discovery: <data> <element key="attribute1"> <key>entity1</key> </element> <element key="attribute2"> <key>entity2</key> </element> </data> Note that the "key" stands for both an attribute name and a nested tag. How can such XML be converted into JSON? Secondly, since every input format needs a very specific preprocessing step to convert it into JSON, it will take a very long time to implement even most frequently used scenarios (CSV in 4.2, XML in 4.4, YAML in 5.0, etc.) In the meantime many users will have to resort to scripting or will simply choose a different monitoring solution. In my understanding, preprocessing pipeline for LLD rules should be just like preprocessing of regular items right to the point where we have an array of some sort (JSON array, XML array, array of /.../g regexp matches, you name it). Then there should be a breaking point stating the type of array we've got. And from there Zabbix should start a bunch of independent preprocessing pipelines to extract values of every LLD macro user needs (I would use XPath here in case of my XML example: string(element/@key) ⇒ {#ATTRIBUTE}, string(element/key) ⇒ {#ENTITY}), each ending with a name for the end result (conventional {#MACRO}). Implementation costs should be fairly low because Zabbix already knows how to iterate JSON and XML arrays, adding iteration of regexp matches or CSV rows shouldn't be difficult. And the end solution will be very flexible and extendable, because user will be able to use all the available preprocessing steps, both to prepare data and extract macro values. |
Comment by Dimitri Bellini [ 2018 Sep 12 ] |
Hi Devs, |
Comment by Alexei Vladishev [ 2018 Sep 21 ] |
Gleb, it is a nice idea at the expense of extra configuration complexity, i.e. we should specify correct data type. Native support of XML is nice to have, I am not sure it is required from day one. Dimitry, please stay on topic. I just attached version 1.0rc3 of the spec, sorry for formatting issues. |
Comment by Glebs Ivanovskis [ 2018 Sep 23 ] |
I really like the idea of auto-completion! |
Comment by Vitaly Zhuravlev [ 2018 Nov 26 ] |
The new version (v.1.1) of acceptance criteria is attached |
Comment by Glebs Ivanovskis [ 2018 Nov 26 ] |
Comment by Ivo Kurzemnieks [ 2019 Jan 31 ] |
Implemented in pre-4.2.0alpha4 (trunk) r89234 |
Comment by Ivo Kurzemnieks [ 2019 Feb 01 ] |
Updated API documentation:
|
Comment by richlv [ 2019 Apr 09 ] |
Thank you for the API documentation links, Ivo. Other relevant documentation pages: |
Comment by Alexander Vladishev [ 2019 Apr 12 ] |
Updated documentation:
|