Ad Widget

Collapse

Why I should link a template to host group?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lucac
    Junior Member
    • Sep 2013
    • 20

    #1

    Why I should link a template to host group?

    Hello everybody,
    first of all sorry for this (probably) idiot question, since I'm quite new to Zabbix
    After reading the manual and docs several times, I missed the point about linking a template to a host group. (besides it's required since a template must belong to at least an host group - or at least that is what I experienced).

    My first tought was that when I create an host within an host group, it automagically inherits all templates defined within the host group, but this is not the case.

    Now I'm thinking that this configuration is useful when you want to segregate access to host group to different users. Since an user must be explicitly granted access to an host group, then he/she can use only templates linked to that host group so it makes sense to link a template to host group.
    Is this right ? There are other reasons I don't see?
    TIA
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    Host groups are just for logically grouping hosts. They form no logic whatsoever.

    Templates are used to apply a bunch of items to several hosts.
    Imagine you have a group of servers on which you like to perform identical checks, that is disk usage, cpu usage, process checks, interface traffic checks.

    You group all items in a template and assign that template to all of your hosts.
    It saves you a lot of time.

    Comment

    • lucac
      Junior Member
      • Sep 2013
      • 20

      #3
      Hi steveboyson,
      thanks for reply but I think you missed my point (or I didn't understand your reply).
      On my mind, the use (and pros) of templates are clear, but I do not understand WHY I must link a template to host group.
      In my mind a template is a model which can be applied to several items. At the same time, a group is an object to join several items together for some specific purpose (permission, for example).

      Thanks

      Comment

      • steveboyson
        Senior Member
        • Jul 2013
        • 582

        #4
        How do you link a template to a host group? I'm afraid you cannot do that.

        Comment

        • BDiE8VNy
          Senior Member
          • Apr 2010
          • 680

          #5
          a logical grouping of hosts [...] may contain hosts and templates [...] not in any way linked to each other[...] are used when assigning access rights to hosts for different user groups.
          See: Zabbix definitions

          Comment

          • lucac
            Junior Member
            • Sep 2013
            • 20

            #6
            OK, probably I'm using the wrong verb (sorry for my english) - to link is not the action I'm referring to.
            When I create a template, I must specify a group (why?)

            Also, when I create a group, I can select hosts (which is expected) but also templates (again, why?).


            Thanks very much for your patience

            Comment

            • steveboyson
              Senior Member
              • Jul 2013
              • 582

              #7
              You MAY add templates to a host group but you are not forced to do so.

              A host group is a group of elements which are used for assigning user rights as BDiE8VNy mentionend earlier.

              You could assign access rights to a group of hosts or even a group of templates to enable users to manage this group.
              Simply take a host group as a collection of objects to define access rights to the objects in the group.

              Comment

              • lucac
                Junior Member
                • Sep 2013
                • 20

                #8
                Thanks you both for pointing me to the right direction.
                So my idea of using host groups for permission was ok. Sorry if I missed the definition as pointer out by BDiE8VNy.

                Thanks you both so much for your help and support of a zabbix newbie

                Comment

                • sxc7541
                  Junior Member
                  • Aug 2015
                  • 4

                  #9
                  Why associate templates with host groups?

                  Apologies for reviving such an old thread (!) but I think I have just found the benefit of associating a template with a host group; here goes:

                  Once this is done, the template gets automatically applied to all hosts within the group.

                  It's a nice way to ensure consistency across all hosts within the group.

                  This is with Zabbix 3.0; YMMV...

                  Comment

                  • chrullrich
                    Junior Member
                    • Jan 2013
                    • 8

                    #10
                    How do you get a template to assign to hosts via the host group? I cannot see UI to make that happen, and it definitely does not happen for me (3.2).

                    AFAIK, templates can be associated with host groups only so they are easier to find in the Zabbix 2 UI (where there is no autocompletion of template names).

                    Comment

                    • vmartin
                      Junior Member
                      • Jun 2020
                      • 6

                      #11
                      FYI: what i did when i need a template assigne to multiple host: i create a group of host(ex: switch) i create a template(ex: switch)(i create both just to be sure, i have in mind i should not add a template if there is not a matching group) then i associate the template(one or many) i want to apply to the template switch, then i apply the template switch to the host(and also the group switch) i hope it help other people who get trought this post

                      Comment

                      Working...