Ad Widget

Collapse

Host prototype derived from self hosted domains

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matt.envsys
    Junior Member
    • Jul 2021
    • 10

    #1

    Host prototype derived from self hosted domains

    Hi all,

    We are using Zabbix to monitor the SSL certificates of our domains. So far we've been adding them manually each time we create a new domain but wondered if this can be done automatically based on a host prototype?

    I've created a plug in that returns the domains hosted on one of our servers in JSON format. An example output of calling that item is:
    Code:
    list.domains                                  [s|[
      {
        "{#DOMAIN}": "example.co.uk"
      },
      {
        "{#DOMAIN}": "testing.co.uk"
      },
      {
        "{#DOMAIN}": "wiki.example.co.uk"
      },
      {
        "{#DOMAIN}": "docs.example.co.uk"
      },
      {
        "{#DOMAIN}": "staging.example.co.uk"
      }
    ]]
    I created a new template called 'domain discovery' with a discovery item that uses the key 'list.domains' and with the following host prototype settings:

    Click image for larger version  Name:	image.png Views:	0 Size:	24.1 KB ID:	505459

    Click image for larger version  Name:	image.png Views:	0 Size:	41.1 KB ID:	505457
    Inherited macros:
    Click image for larger version  Name:	image.png Views:	0 Size:	27.5 KB ID:	505458

    The template for the host name should add test into the name to ensure there is a difference between existing hosts and those that are discovered. This template was attached to a test host, the item is showing as enabled but no hosts have been generated.

    Is there something wrong with my JSON formatting, or something I have incorrectly configured in my template?

    Thanks
    Last edited by matt.envsys; 21-07-2025, 14:37.
  • matt.envsys
    Junior Member
    • Jul 2021
    • 10

    #2
    I managed to get the hosts to be created by changing the data contained within the JSON return and added a LLD Macro. However the new hosts generated by the prototype are inheriting settings from the parent host that is gathering this data, such as encryption and some other macros. Is there a way to override this behaviour?

    Comment

    Working...