Ad Widget

Collapse

Inherited / overwrite items ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lbm
    Member
    • Feb 2020
    • 36

    #1

    Inherited / overwrite items ??

    I have an host, which is member of several templates, kinda normal.

    E.g.
    Template1
    Template2

    Template1, has an memory "vm.memory.size[available]" item, for which the server reports this data.

    Now I want to create an trigger on Template2, with this item from Template1. If I do so, the trigger is created in Template1, which I do not want, since I only want this trigger to apply for servers in Template2.
    I cannot create the same item again on Template2, so I can use the item only for this template, since I then get the following error: "

    Item "vm.memory.size[available]" already exists on "XX", inherited from another template.
    How do I come around this ?
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Does "template nesting" allow you to work around this problem? https://www.zabbix.com/documentation...plates/nesting

    If template nesting doesn't provide a workaround, then another approach I would consider is putting the trigger in template 1, but use a macro or macros so that the trigger never fires by default. Then, for servers that would have had template 2 applied to them, override the macro value so that the trigger is more relevant. This too may not do what you want, but it's another approach to consider.

    Comment

    • lbm
      Member
      • Feb 2020
      • 36

      #3
      Thanks for the reply.
      I've actually tried to link the templates together, but then I get this.:

      Template cannot be linked to another template more than once even through other templates.
      The macro override, was actually a really good suggestion. Unfortunately, I cannot get it to work, because I think that the macro value only is read from the template where the trigger is.
      E.g.
      Template1, added macro, and reconfigured trigger to use this macro. (this works)
      Template2, added macro, with same name as above with an value much less strict, but this doesn't work. The above trigger is never fired.

      --edit--
      Think I got it working. The order is apperently important.


      So, i've created an global macro instead.
      So now I have this.

      Template1: No macro, it inherits it from the global macro.
      Template2: has macro
      Last edited by lbm; 04-02-2020, 11:44.

      Comment

      Working...