Ad Widget

Collapse

Discovery Item, LLD, Jsonpath bug?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HaveDill
    Senior Member
    • Sep 2014
    • 103

    #1

    Discovery Item, LLD, Jsonpath bug?

    According to Zabbix's documentation, since 4.2 we have not needed the "data" field for json values.

    Note that since Zabbix 4.2, the format of the JSON returned by low-level discovery rules has been changed. It is no longer expected that the JSON will contain the "data" object. Low-level discovery will now accept a normal JSON containing an array, in order to support new features such as the item value preprocessing and custom paths to low-level discovery macro values in a JSON document.

    Built-in discovery keys have been updated to return an array of LLD rows at the root of JSON document. Zabbix will automatically extract a macro and value if an array field uses the {#MACRO} syntax as a key. Any new native discovery checks will use the new syntax without the "data" elements. When processing a low-level discovery value first the root is located (array at $. or $.data).

    However, on 4.4.3 i constantly need to write custom javascript to put a json return into a data array. Am i hitting a weird bug, or am i reading the documentation wrong? My json return from Jenkin's api is valid, and so are my json paths.

    Click image for larger version

Name:	2020-02-25 09_30_57-Window.png
Views:	1064
Size:	6.7 KB
ID:	396318
  • 20k
    Junior Member
    • Apr 2017
    • 18

    #2
    Hi,

    I'm facing the same behaviour already reported here: https://www.zabbix.com/forum/zabbix-...the-data-array
    As you said, I need to write my custom External scripts to bypass this, which is a bit annoying.

    I'm still hope we can get an answer to clarify this.

    20k

    Comment

    • 20k
      Junior Member
      • Apr 2017
      • 18

      #3
      Thank for your reply.
      I've been handling JSON for years and I'm sure it is valid.

      The case I reported last October was just an example but I had other similar issues with other valid JSON.

      It just seem to me that the JSON Path based discovery unfrtunately still expect the data array and I did not found any documentation regarding this.


      Comment

      Working...