Ad Widget

Collapse

Trigger name & JSONPath

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marmax
    Junior Member
    • Nov 2020
    • 2

    #1

    Trigger name & JSONPath

    Hi guys,
    I am trying to wrap my head around the following problem but I am not able to figure it out.

    I configured an item of type "Zabbix trapper" (let's say it's ) and I am able to receive the data from an external (3rdparty) application which sends me a JSON with the following format:
    Code:
    {
       system: "system-23",
       status: "Error",
       issue: {
          id: "x-12345",
          tenant: "tenant-1",
          severity: "Warning",
          message: "XZ-2546 - no data in last 1 hour"
       }
    }
    I would like to set a trigger (or triggers) in a way that:
    • I can reuse the detected severity (it follows 1:1 the zabbix severity)
    • it has a name constructed out of the json, possibly using JSONPath - e.g. "tenant-1 | XZ-2546 - no data in last 1 hour"
    • allows multiple events (tagged with the $.issue.id)

    Question 1: Is it a good idea to keep the JSON as item value or should I apply some preprocessing? Please note, that I would like to use JSONPath in both trigger name and expression, but it seems impossible - as only macros like {ITEM.VALUE} are supported

    Question 2: Or should I better create dependent items (id, tenant, message) which use JSONPath preprocessing to grab the particular info and then construct multi item trigger?

    Question 3: For severity, is there a chance to create one "dynamic" trigger which grabs the severity from the item - or do I have to crete multiple triggers (per severity) which match the severity in json?

    Any info/answers/hints will be highly appreciated!
Working...