Ad Widget

Collapse

Unsupported JSON path - Zabbix 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • um3n
    Member
    • Aug 2021
    • 47

    #1

    Unsupported JSON path - Zabbix 6.0

    Hey guys,

    i'm reaching some point of frustration with jsonpath and LLD discovery.

    I'm trying to monitor some milestones in our gitlab environment. I query the gitlab api with a http agent discovery item.


    Click image for larger version

Name:	Screenshot_20220228_134052.png
Views:	2490
Size:	42.3 KB
ID:	440571
    The testquery gets me a result.

    Click image for larger version

Name:	Screenshot_20220228_134236.png
Views:	2302
Size:	43.6 KB
ID:	440572

    I created an itemprototype with this, but the items will not be created.

    Click image for larger version

Name:	Screenshot_20220228_134428.png
Views:	2287
Size:	39.2 KB
ID:	440573 Click image for larger version

Name:	Screenshot_20220228_134412.png
Views:	2308
Size:	71.3 KB
ID:	440574

    I get this error:

    Code:
    Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "[22]].state".
    Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "[15]].state".
    Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "[14]].state".
    Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "[13]].state".
    Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "[12]].state".
    If I escape the ID LLD macro in the prototype, zabbix will start create the items, but cannot query them, because the LLD macros will be stored with square brackets.
    I also tried the mentioned solutions from this thread, but this does not work either.

    Any ideas?
    Thanks and kind regards,

    Ulli

  • um3n
    Member
    • Aug 2021
    • 47

    #2
    Hey guys,

    I hope you can help me, when I post some more infos.

    When I use some escaping, the items can be created by zabbix, but jsonpath couldn't get values and the items will be unsupported.

    Click image for larger version

Name:	Screenshot_20220301_160850.png
Views:	1999
Size:	112.7 KB
ID:	440666

    Click image for larger version

Name:	Screenshot_20220301_160905.png
Views:	1999
Size:	35.1 KB
ID:	440665

    Click image for larger version

Name:	Screenshot_20220301_160928.png
Views:	2007
Size:	33.6 KB
ID:	440664

    I need some help. We don't want to create an external script

    Comment

    • um3n
      Member
      • Aug 2021
      • 47

      #3
      i solved it myself with a not so great solution but it works.

      In the discoveryrule I added two preprocessing steps to replace the square brackets. In my case it works, cause there are no arrays in the response. If you have some arrays in your json response, that will not work!

      Click image for larger version

Name:	Screenshot_20220302_134142.png
Views:	1343
Size:	43.7 KB
ID:	440739

      Comment

      • xoile
        Junior Member
        • Apr 2024
        • 1

        #4
        Originally posted by um3n
        i solved it myself with a not so great solution but it works.

        In the discoveryrule I added two preprocessing steps to replace the square brackets. In my case it works, cause there are no arrays in the response. If you have some arrays in your json response, that will not work!

        Click image for larger version

Name:	Screenshot_20220302_134142.png
Views:	1343
Size:	43.7 KB
ID:	440739
        what was the replacement?

        Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #5
          If the returned value of the item is an array, I think you can use the Trim preprocessing instead.
          Click image for larger version

Name:	image.png
Views:	663
Size:	3.6 KB
ID:	482422

          Comment

          Working...