[ZBXNEXT-1850] resolve trigger dependencies on hosts only Created: 2013 Jul 22  Updated: 2015 Jun 30

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A), Server (S)
Affects Version/s: 2.0.4
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Dmitry Samsonov Assignee: Unassigned
Resolution: Unresolved Votes: 7
Labels: nested, templatelinking, triggerdependencies
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File zabbix_dependencies_problem.jpg    

 Description   

Hello!
We have few levels of templates and some problems adding trigger dependencies between them:
template hostsA linked to template "pci slots" linked to template "ethernet controllers"
template hostsA linked to template "server alive"
template hostsB linked to template "server alive"
template "ethernet controllers" has trigger that should be dependent to trigger in template "server alive"

When I add such dependency I get error: Not all templates are linked to "pci slots".

Is it a bug or am I doing something wrong?



 Comments   
Comment by Oleksii Zagorskyi [ 2013 Jul 23 ]

See:
https://www.zabbix.org/wiki/Docs/specs/ZBX-4333
ZBX-4333
and try to estimate your attempt again.

After reading issue description I'm not sure I can understand correctly template linkage

Comment by Dmitry Samsonov [ 2013 Jul 23 ]

I can't see any inconsistency with documentation and specification you have provoded, but it still fails.
I will try to add image like in zabbix specs.

Comment by Dmitry Samsonov [ 2013 Jul 23 ]

Red arrow on the image is the trigger I am trying to add:

Comment by richlv [ 2013 Jul 24 ]

this is not possible as "template pci slots" would have trigger t2 that would depend on trigger t1 from "template server alive", but "template pci slots" is not linked to "template server alive", thus you would get a dependency on a non-existent trigger.

seems to work as expected

Comment by Dmitry Samsonov [ 2013 Jul 24 ]

If we remove template "pci slots" (and link "ethernet controllers" directly to "HostsA"), then I can create dependency from template "ethernet controllers" to template "server alive", but they also are not linked.
It is possible just because thay are templates and if we will try to link template "ethernet controllers" (in simplified scheme without template "pci slots") to host, then we would get error "Trigger in template ethernet controllers has dependency with trigger in template server alive".

To conclude: 1-level templates may have trigger with dependency to any other not linked template, but 2 level templates may not.

Seems to be wrong, isn't it?

Comment by richlv [ 2013 Jul 24 ]

no, that seems to be correct. in that case both "template ethernet controllers" and "template server alive" are linked to "template HostsA", and trigger dependency has the trigger to rely on.

think about it this way - if t2 on "template pci slots" ends up depending on t1... there is no t1 on "template pci slots"

Comment by Dmitry Samsonov [ 2013 Jul 24 ]

think about it this way - if t2 on "template pci slots" ends up depending on t1... there is no t1 on "template pci slots"

Why is it a problem? It's just a template, just as "ethernet controllers".
Template "ethernet controllers" also has trigger t2 depending on t1 and there is no t1 on that template.

It is normal to deny to add hosts to just one template if there are triggers with dependencies to another templates. But templates do not count triggers, so why it should be a problem to have templates with just a half of dependency?

Comment by richlv [ 2013 Jul 24 ]

"template ethernet controllers" is the originating template for t1. anything linked to it must have all dependencies, too - that would be t1 in this case.

it does not matter whether it is template or host, it's a configuration data consistency question, nothing to do with trigger evaluation etc

when we link something to a template which has a dep to another template, we resolve that dependency locally, which is not possible in this case

Comment by Dmitry Samsonov [ 2013 Jul 25 ]

I don's see any reasons to resolve that dependency locally for templates, because we already has inconsistent dependency in template "ethernet controllers" for example.
Don't you think so?

Comment by Dmitry Samsonov [ 2013 Aug 05 ]

Will this report be considered as problem?

Comment by richlv [ 2013 Aug 05 ]

theoretically, we could consider trigger dependencies only when resolving them on hosts and ignore while we are still in templates.
there might be unintended consequences, though - this should be carefully evaluated and tested (both frontend and server changes will be required).
for now it works as designed -> moving this to feature requests

Comment by Dmitry Samsonov [ 2013 Aug 05 ]

Thank you.

Comment by George Machitidze [ 2014 Mar 22 ]

This is REALLY annoying and VERY useful thing - there are many services that depend on each-other and we don't want to create separate templates for all hosts and copy everything we need just to make triggers work.

Possible solution is to:
1. allow creation of triggers, warn if linked element/target doesn't exist
2. disable trigger if linked element doesn't exist
3. warn user upon deletion of linked element and disable trigger
4. warn user upon creation of linked element which will be used by trigger
5. renaming template must not break links - i.e. use template IDs instead of names (back)

Comment by Janne Korkkula [ 2014 Nov 14 ]

I agree. The simplest case: almost all of our hosts have a basic template linked which includes the icmppingsec simple check and an appropriate trigger. We'd like to depend on that trigger for other checks. This cannot be done, neither is there any useable workaround, because:
Item "icmppingsec" already exists on "host", inherited from another template. There are many other cases, this is just a simple example.

Generated at Sat Apr 27 02:32:44 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.