Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-10068

LLD macros are not being resolved in JSONPath preprocessing and LLD macro definition

XMLWordPrintable

    • S25-W28/29

      Problem description: LLD macros are not being resolved in preprocessing step "JSONPath" parameter and in the "JSONPath" field in LLD configuration form in LLD macro definition field.
      Previously, when nested LLD was not implemented there was no use case form opening LLD macros in the above mentioned fields, but now, after introducing nested LLD, LLD macro resolution in these fields becomes crucial, as without it we are limiting this functionality only to those use cases where all the keys in the received JSON are known and constant.
      For example, currently, we would not be able to use an LLD macro to get the value of "db_name" ("db1") from the above JSON, and then use it in JSONPath to get the value of key "ts1" in the below JSON:

      '{"data":[{"db_name":"db1","ts_data":[{"db1":"2GB"},{"common":"5GB"}]}]}'
      

      Steps to reproduce:

      1. Import the following host: host_with_LLD_macro_in_JSONPath.yaml
      2. Send the above mentioned JSON to the LLD rule "Root level LLD" that is present on the host:
        ./bin/zabbix_sender -z 127.0.0.1 -s test -k trap -o '{"data":[{"db_name":"db1","ts_data":[{"db1":"2GB"},{"common":"5GB"}]}]}'
        
      1. Double check that LLD rule "1st level LLD" is discovered by LLD rule "Root level LLD"
      2. Send the same value again to the "Root level LLD" discovery rule
      3. Check the list of items for this host

      Result: Item was not discovered from the discovered LLD rule. The following error is visible next to the discovered LLD rule in the list of LLD rules:

      Cannot process LLD macro "{#L1}": unsupported construct in jsonpath starting with: "{#L0}".
      

      Expected: LLD macro {#L0} should have been opened in the JSONPath field in the definition of {#L1} macro in LLD rule "1st level LLD". Item "1st level item prototype" should have been discovered.

            MVekslers Michael Veksler
            solonkins Sergejs Olonkins
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 6h
                6h