[ZBXNEXT-4480] Discovery from custom CSV string Created: 2018 Apr 04  Updated: 2024 Feb 28  Resolved: 2024 Feb 28

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G), Server (S)
Affects Version/s: 4.0 (plan)
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Roman Rajniak Assignee: Michael Veksler
Resolution: Workaround proposed Votes: 3
Labels: items, lld, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screenshot-1.png    

 Description   

To create a set of predefined items using #MACRONAME we can use "Discovery rule" which calls external script.
But if set of values would be provided in CSV format, we do not need create dummy script in external scripts which returns constant JSON string.

For instance, in the discovery rule add new Type in list like "Custom"
or to Zabbix agent something like CSV2JSON[<macroname>,<string value list>]
Example of configured Discovery rule:
Key: csv2json[MACRONAME1,"TEST,PROD,DEVEL"]
Output like:

{"data":[{"{#MACRONAME1}":"TEST"},{"{#MACRONAME1}":"PROD"},{"{#MACRONAME1}":"DEVEL"}]}


 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 04 ]

Duplicate of ZBXNEXT-4086?

Comment by Roman Rajniak [ 2018 Apr 04 ]

No, This is only for static list of values configured in frontend, without any coding.
Just for example: "TEST,PROD,DEVEL" constant values to parse in macro #MACRONAME1
which I can use to multiply Item prototypes

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 04 ]

Ah, got it.

Comment by Roman Rajniak [ 2018 Apr 04 ]

And maybe later one more improvement: <macroname> as string with CSV list of MACRONAMEs
csv2json["MACRONAME1,MACRONAME2","TEST,1,PROD,4,DEVEL,9"]
output parsed as:

{"data":[
   { "{#MACRONAME1}":"TEST", "{#MACRONAME2}":"1"   },
   { "{#MACRONAME1}":"PROD", "{#MACRONAME2}":"4"   },
   { "{#MACRONAME1}":"DEVEL", "{#MACRONAME2}":"9"   }
]} 
Comment by Roman Rajniak [ 2019 Jan 09 ]

Part of ZBXNEXT-4854 ?

Comment by Roman Rajniak [ 2019 Sep 23 ]

Simmilar to ZBXNEXT-3970

Comment by Alex Kalimulin [ 2024 Feb 28 ]

Closing because Script items seem to address this use case. Feel free to reopen if this is not the case.

Generated at Fri Apr 19 09:05:21 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.