Hello,
I have a problem, which, I am quite sure, will be just some small thing forgotten on my side.
I have a script which is returning a json in this format:
{ "data": [{"GRPNAME": "groupmane1"},{"GRPNAME": "groupmane2"},{"GRPNAME": "groupmane3"}]}
I have a template with Discovery, where Key is a userparameter (custom.discovery), which is just calling the scipt returning the above data.
UserParameter=custom.discovery[*], sh /etc/zabbix/zabbix_agent2.d/discover_groups.sh
As a LLD Macro I have: {#GRPNAME} and JSONpath $..GRPNAME.
Then I am usng the Macro in Item prototype, but the names of groups are generated as ["groupname1"] etc.
I can not find a good way, how to get rid of opening and closig backets and quotations, so the Macro value will be just "groupname1", "groupname2" ... without quotes, so the items created from prototypes will have the value without the brackets.
Does anybody have an idea, what I am doing wrong?
Zabbix 6.0.12, but I have not seen any LLD Rule related fixes in newer LTS version
I have a problem, which, I am quite sure, will be just some small thing forgotten on my side.
I have a script which is returning a json in this format:
{ "data": [{"GRPNAME": "groupmane1"},{"GRPNAME": "groupmane2"},{"GRPNAME": "groupmane3"}]}
I have a template with Discovery, where Key is a userparameter (custom.discovery), which is just calling the scipt returning the above data.
UserParameter=custom.discovery[*], sh /etc/zabbix/zabbix_agent2.d/discover_groups.sh
As a LLD Macro I have: {#GRPNAME} and JSONpath $..GRPNAME.
Then I am usng the Macro in Item prototype, but the names of groups are generated as ["groupname1"] etc.
I can not find a good way, how to get rid of opening and closig backets and quotations, so the Macro value will be just "groupname1", "groupname2" ... without quotes, so the items created from prototypes will have the value without the brackets.
Does anybody have an idea, what I am doing wrong?
Zabbix 6.0.12, but I have not seen any LLD Rule related fixes in newer LTS version
Comment