Ad Widget

Collapse

json

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Henri
    Junior Member
    • Oct 2019
    • 1

    #1

    json

    If you send a httprequest to a web address (URL) under steps in a web scenario under steps, this (in our case) will return with a JSON result.
    JSON stands for JavaScript Object Notation.

    Example is:
    {"status": "UP", "diskSpace": {"status": "UP", "total": 107371032576, "free": 89948925952, "threshold": 10485760}, "jms": {"status": "UP"}}

    Is there a possibility to parse this JSON response so that I can immediately ask for the value of, for example: diskSpace.status, diskSpace.threshold or jms.status?
    We are currently looking at the content of the response: if the word "UP" is in there, the status is OK, but I specifically want to know the status of, for example, "jms"
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Preprocessing is not supported in Web Monitoring currently. I suggest you to use item type "HTTP agent", which will similarly perform an HTTP request and receive JSON. This item type supports Item Preprocessing, which you can use to extract the needed information using JSONPath. If you declare this item as master item, you will be able to populate multiple values from this JSON to dependent items: https://www.zabbix.com/documentation...ependent_items
    Last edited by dimir; 02-10-2023, 12:26.

    Comment

    Working...