A
A
Alexander Didenko2021-12-21 18:25:22
JSON
Alexander Didenko, 2021-12-21 18:25:22

How to make a dependent item in Zabbix LLD (multi-level JSON)?

How to correctly create a dependent element in Zabbix in low-level discovery and read data from JSON?

Here is an example structure:

{
    "host": "MR4",
    "data": [
      {
        "{#PROC}": "VIP1_iP11",
        "data": [
            {
              "{#CENCNs}": "CENCN1"
            },
            {
              "{#CENCNs}": "CENCN2"
            }
        ]
      },
      {
        "{#PROC}": "VIP2_iP12"
      }
    ]
  }

The first level ({#PROC}: VIP1_iP11, VIP2_iP12) works well.

Photo1 , photo2
kLJ0BzaMsTo.jpg?size=1314x393&quality=95&sign=21f70516432a696726d624f9721bab86&type=album
gHVg1MUxYwE.jpg?size=1307x589&quality=95&sign=cd98d3d147a9004c135828095b585160&type=album

But how to create a dependent data element in the "Prototypes of data elements" - I don’t even understand. There's probably something in the "Preprocessing" should be specified. What I just did not try to specify there - the dependent element is not processed.

Help please who understands this!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grishin, 2021-12-22
@vesper-bot

Divide the LLD autodiscovery queries into two different ones, in one you return the top-level objects {#PROC} and only them, in the second you return the list {#CENCN} by the PROC object identifier. Next, along with the prototype of the found PROC object, write the LLD auto-discovery prototype, in which you specify query number two for the search and the prototype of the {#CENCN} element from its results.
Dependent objects in Zabbix mean a slightly different object - for example, if there is a request for the full state of an object that returns data in JSON, Zabbix can store this JSON as text, and by its value you can create dependent objects using the state value as the original and JSON- a transformation like $.path[index].subpath of the required configuration to pull the value from this JSON. In addition, it is possible to convert values ​​with the second (next) preprocessor, for example, decrypt it from the state number, a la 2 - "running".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question