Ad Widget

Collapse

Nested discovery/LLD from JSON data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lolstrup
    Junior Member
    • Jul 2021
    • 11

    #1

    Nested discovery/LLD from JSON data

    Hi,

    I have a situation where I need 2-3 levels of LLD.
    The data structure is like so:
    1. Installation A
      1. Communicator A
        1. Device 1
        2. Device 2
        3. Device 3
      2. Communicator B
        1. Device 4
        2. Device 5
    2. Installation B
      1. Communicator C
        1. Device 6
        2. Device 7
        3. Device 8
    And so on.
    We need to monitor up/down status of each communicator and device.
    I retrieve everything from a JSON API separately, i.e.:
    1. Get installations
    2. For each installation, get communicators
    3. For each communicator in installation, get devices
    Each step also contains the up/down state.

    I know how to do this in a single dimension, but I can't seem to figure out the best way to do it for a nested/cascading structure.
    Is my only option to have each installation as a separate host?
  • lolstrup
    Junior Member
    • Jul 2021
    • 11

    #2
    I managed to solve this by adding a Discovery Rule on the main host, with a Host Prototype that spawns virtual hosts for each Installation.

    It applies a template I made, with Discovery Rules for Communicators and Devices, which uses the parent host interface.
    I had to make "master" items for both, do the discovery based on that, and make Dependent Item Prototypes to extract information from the JSON blob.

    I didn't manage to make it cascading, but I realized my data doesn't really have a relationship between Communicator and Device, so that made the job much easier.

    Comment

    • jameskirsop
      Member
      • Jul 2018
      • 32

      #3
      lolstrup, glad you got something working - but you might want to vote for this request to make life easier in the future, should it get accepted and pushed into a release: https://support.zabbix.com/browse/ZBXNEXT-1527

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        https://support.zabbix.com/browse/ZBXNEXT-1527 is almost ready, stay tuned!

        Comment

        • lolstrup
          Junior Member
          • Jul 2021
          • 11

          #5
          Originally posted by dimir
          Sounds great. We are looking forward to this!

          Comment

          Working...