[ZBX-21130] mandatory usage of LLD MACRO in item prototype Created: 2022 May 30  Updated: 2024 Apr 10  Resolved: 2022 Sep 12

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D), Frontend (F), Server (S)
Affects Version/s: 4.0.40, 5.0.23, 6.0.4
Fix Version/s: 6.4 (plan)

Type: Documentation task Priority: Major
Reporter: Andrey Tocko (Inactive) Assignee: Martins Valkovskis
Resolution: Fixed Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File Template_Single_spawn_with_overrides.xml     XML File lld-single_4.xml    
Issue Links:
Sub-task
Team: Team A
Sprint: Sprint 92 (Sep 2022)
Story Points: 1

 Description   

On a discovery phase item prototype without LLD.MACRO throws an error "Item key already exists". Even if there is only single item discovered, it is not created.

Did tests on all current LTS versions(4,5,6) and behavior is the same: No LLD.MACRO in item key - NO ITEM on discovery(not even single)

For now only workaround is to intercept lld by JS preporcessing and insert empty value to custom lld.macro. Then use id as parameter of a key. But it limits usage of items without parameters.

Test template with trappers discovery starting v4: lld-single_4.xml
Using overrides does not help - without LLD.MACRO - 0 items.
Tests templates(with and without lld macro in parameters) with overrides starting with v5: Template_Single_spawn_with_overrides.xml
Template discovers systemd services and assigns simple net.tcp.service checks to each discovered service. Overrides are great for automation, but current behavior limits the usage.

---------------------------------------- In case if this behavior is by design : --------------------------------------------------------------------------------
Could you please change misleading documentation, which states that we MAY use LLD.MACRO in prototype configuration. To must use LLD.MACRO in item prototype:
https://www.zabbix.com/documentation/current/en/manual/discovery/low_level_discovery/item_prototypes

A warning or validation could be also added to Frontend on prototype creation windows.



 Comments   
Comment by Dimitri Bellini [ 2022 May 30 ]

I would like to mention a possible user scenario.
In some "automated" environment we need to limit the number of possible linked template to the hosts.
At the moment we can use a LLD discovery to detect a specific "service" and using the "override" feature we can activate a specific "Itemprototype".
Thanks DevTeam

Comment by Alexander Vladishev [ 2022 Sep 03 ]

Items and item prototypes cannot have the same keys. Otherwise, it will not be possible to address them from the trigger expression of prototypes in any way.

Comment by Dimitri Bellini [ 2022 Sep 05 ]

Please keep in mind that we faced the same problem of "Item key already exists" when the LLD provide "only a single" result (as I well remember ) For instance "as already mentioned" for "service discovery"

Thanks so much

Comment by Martins Valkovskis [ 2022 Sep 09 ]

Updated documentation for the supported versions mentions the mandatory use of LLD macros in prototype item keys: 4.0, 5.0, 6.0, 6.2, 6.4.

Generated at Tue May 06 07:25:37 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.