-
Incident report
-
Resolution: Cannot Reproduce
-
Trivial
-
None
-
5.0.1
-
None
-
None
-
CentOS 8, MariaDB
Steps to reproduce:
- Add HTTP agent item on template A, which calls json api which returns the following data
[{"name":"DEVICE1"},{"name":"DEVICE2"}]
- Add JavaScript preprocessing step with following code on the item defined above (which adds the groupname attribute to each of the elements in the json array returned above, from the {$ZABBIX_HOSTGROUP} macro):
newValue = JSON.parse(value); var groupName = '{$ZABBIX_HOSTGROUP}'; for (i = 0; i < newValue.length; i++) { newValue[i].groupname = groupName } return JSON.stringify(newValue);
- Add discovery rule on template A, with the following LLD macro (extracts the groupname we added above to the {$ZBXGRP}):
- Add host prototype to the discovery rule, while adding the {$ZBXGRP} macro to the "Group Prototypes"
Result:
The host prototype does not get assigned to the group, the preprocessing step works if i look in the "Latest Data" tab, so the problem is probably with the LLD macro, or the group prototypes
Expected:
The host prototype should be assigned to the hostgroup, as defined in {$ZBXGRP}