[ZBXNEXT-5517] make host macro values editable on hosts that are generated from a host prototype Created: 2019 Oct 18  Updated: 2024 May 13  Resolved: 2022 Jul 05

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 4.4.0
Fix Version/s: 6.2.0rc1, 6.2 (plan)

Type: Change Request Priority: Blocker
Reporter: Ronald Rood Assignee: Miks Kronkalns
Resolution: Fixed Votes: 35
Labels: grouping, lld, macros, templates, usability
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified
Environment:

generic


Attachments: PNG File Screenshot from 2022-05-06 15-59-20.png     PNG File Screenshot from 2022-05-06 15-59-29.png    
Issue Links:
Causes
causes ZBX-21190 Template macros of host prototype loo... Closed
Duplicate
Sub-task
Sub-Tasks:
Key
Summary
Type
Status
Assignee
ZBXNEXT-7652 Frontend changes to modify macros of ... Specification change (Sub-task) Closed Antons Sincovs  
Team: Team B
Sprint: Sprint 87 (Apr 2022), Sprint 88 (May 2022), Sprint 89 (Jun 2022)
Story Points: 2

 Description   

create a discovery rule with a host prototype that has template[s] with macros in it.

send a lld array to that rule so host[s] are generated with the assigned template[s].

Now try to finetune the tuneables.

The tuneables should be editable, otherwise the hostdiscoveries using host prototypes make no sense since we cannot tune tresholds on discovered hosts. As far as I know there is no workaround for this, other than creating templates for every host, making templates a bit dubious.

A similar situation exists for host group memberships.

Host generation by host prototypes is far easier than using the api's or web gui. Too bad that currently it is not usable. It would be nice to have the heavy lifting done and allow for some fine tuning like adjusting macro values and group membership.



 Comments   
Comment by Glebs Ivanovskis [ 2020 Apr 25 ]

Fine tuning of thresholds on discovered hosts can be done using user macro context. Trigger prototype will look like:

{host:item.last()} > {$THRESHOLD:"{#DISCOVERED.HOST.NAME.OR.WHATEVER}"}

Then you can set baseline {$THRESHOLD} for all discovered hosts and {$THRESHOLD:foo}, {$THRESHOLD:bar}, etc. for hosts "foo", "bar", etc.

Comment by Marcel Renner [ 2021 Aug 30 ]

+1 Macros should be editable for discovered hosts as well. Otherwise, this feature is hardly useful for enterprise environments. Unfortunately, user macro context is not practical for this because the fine-tuning still has to be done in the VMware templates. As soon as you have several 100 or 1000 user macro context objects, it is not easy to manage. Especially since a simple user (and not a Zabbix administrator) hardly understands this procedure, if at all. And if you don't want Zabbix users to be able to edit templates, this workaround won't work anyway.

From a user's point of view, it is difficult to understand why discovered hosts by network or Zabbix agent discoveries can be modified, but host prototypes by a VMware discovery cannot. There will certainly be a technical reason for this, but the behavior should still be identical everywhere.

Comment by gofree [ 2021 Oct 26 ]

I think the same should go with tags - currently you can't add tags to discovered hosts. Again this is often needed in large environments where tags are bringing a lot of logic into 3rd party integrations.

Comment by Nathan Liefting [ 2021 Nov 04 ]

I agree, this should be implemented for both tags and macro's. VMWare monitoring especially is now in a state where it feels like you are locked into a position where the only way to override stuff is by creating multiple templates.

For example, if one had a test VMWare environment and wanted to only get production level notifications. Two templates would need to be made and maintained. One with no tag or the tag:test and another with tag:production.

Comment by Леонид Игоревич Спирин [ 2021 Nov 14 ]

Is it possible to use templates with external checks {HOST.NAME } for output to the map?

"Unknown": the output in such cases is a very common problem, since macros are not revealed on maps. How to solve it? I would like to create one template per nodes, rather than creating separate data elements.

Comment by Rodrigo P [ 2021 Dec 02 ]

Agree with @gofree. I think it's useful with tags as much as with macros.

Comment by Alexei Vladishev [ 2022 Mar 30 ]

Similar feature request for tags, ZBXNEXT-7591.

Comment by Alexei Vladishev [ 2022 Apr 08 ]

Just a quick status update. This functionality will be available in Zabbix 6.4. It could be possibly implemented earlier in Zabbix 6.2, depending of the final release date.

Comment by Dimitri Bellini [ 2022 May 06 ]

Dear DevTeam,
-I have tested this feature on Zabbix 6.2beta1 but it seems that Zabbix is not able to expand the LLD Macro inside the Hostprototype TAG and Macro.
Macro section

Tag section

-
I leave the comment only to show how much I'm a monkey was my fault on JSONPATH syntaxes...
When you work with the MACRO you have to pay a lot of attention and follow the right guidelines.

PS: Why the "TAG" tab do not show the number of tags like we can have for Macro?

Comment by Alexei Vladishev [ 2022 May 09 ]

dimitri.bellini, this feature is not implemented yet. It is too early for any testing.

Comment by Dimitri Bellini [ 2022 May 09 ]

@Alexei I got you, thanks so much

Comment by Miks Kronkalns [ 2022 Jun 08 ]

Implemented in:

Documentation updated:

Comment by Miks Kronkalns [ 2022 Jun 09 ]

Updated API documentation pages:

Documentation updated:

Generated at Mon Jun 30 08:11:55 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.