Ad Widget

Collapse

Auto-registration question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • majorkuso
    Junior Member
    • Oct 2019
    • 26

    #1

    Auto-registration question

    Is it possible to auto register a server with a service as criteria? an example would be if it has a specific service or services, then put it in this group and link this template.
  • gert.derouck
    Member
    • Jan 2020
    • 69

    #2
    Hi,

    you can use a custom cmd in the HostMetadataItem setting in your agent config.
    Example: i use following on our Linux servers to attach different templates depending on the host type:

    Code:
    HostMetadataItem=system.run["if dmidecode -s system-product-name |grep -q VMware ; then echo Linux VMware; else if dmidecode -s system-product-name |grep -q RHEV ; then echo Linux RHEV; else echo Linux Physical; fi; fi"]
    On the server side, you can add several auro-registration actions with different conditions based on the value of the HostMetadataItem.

    See also: https://www.zabbix.com/documentation...o_registration


    Another option is to link the templatee afterwards: we discussed this also in following post: https://www.zabbix.com/forum/zabbix-...to-host-groups

    Regards,
    Gert

    Comment

    • majorkuso
      Junior Member
      • Oct 2019
      • 26

      #3
      Can I have multiple host meta data items in my config? I have one for system.uname how would I specify the second one without conflict?

      Comment


      • gert.derouck
        gert.derouck commented
        Editing a comment
        You can make sure that the output of uname is also included in your custom HostMetadataItem.
    • majorkuso
      Junior Member
      • Oct 2019
      • 26

      #4
      Can you give an example of this?

      Comment


      • gert.derouck
        gert.derouck commented
        Editing a comment
        The example is already in my 1st post...
        uname on a linux: 'Linux'
        So i make sure that the output of my HostMetadataItem also includes this.

        Maybe try to explain what different types of hosts (different templates) you want to link during autodiscovery.
    • majorkuso
      Junior Member
      • Oct 2019
      • 26

      #5
      Most if not all of my hosts will be windows based, I could create a trigger to move/copy the hosts to a different group and link if they have the desired services on them.

      Comment

      • gert.derouck
        Member
        • Jan 2020
        • 69

        #6
        INdeed, i think that's the way to go. That's why i included this link: https://www.zabbix.com/forum/zabbix-...to-host-groups

        Comment

        Working...