Ad Widget

Collapse

JSON Parsing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jpmorgan29
    Junior Member
    • Apr 2018
    • 9

    #1

    JSON Parsing

    Hi guys,

    I have a certain problem with showing my desired output as an Item.

    I have a UPS that shows data in JSON (localhost:8888/0/json) and I'd like to add some values as an item.


    I updated my Zabbix to 3.4 because I saw the preprocessing JSON path.

    Yet when I try to create an item and let's say I'd like to show the key value:




    I'm clearly stuck at this and can't seem to get a result


  • jpmorgan29
    Junior Member
    • Apr 2018
    • 9

    #2
    Just in case anyone is wondering:

    I fixed this by adding another preprocessing step:
    Code:
    Regular Expression ({.+}) (in my case)
    JSON Path: $.key
    Now the problem with that is , if you'd like to display more values for example: Status, upsTemp,...
    You'd have to make several different regexp's because Zabbix will only allow you to use 1 request from the same link with the same regexp.

    You could for example also use: web.page.regexp and put your regexp in there
    Code:
    [I]web[/I].[I]page[/I].[I]regexp[/I][[I]host[/I], <[I]path[/I]>, <[I]port[/I]>, <[I]regexp[/I]>, <[I]length[/I]>]
    as length you could just do: \0 or \1.
    But it sure as hell limits your output values.

    Comment

    Working...