Ad Widget

Collapse

Trigger should show content of a json file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zabbix_Julian
    Junior Member
    • Jul 2022
    • 25

    #1

    Trigger should show content of a json file

    Hi,

    I am in the process of setting up Zabbix.
    I have created an item and a trigger, which triggers a trigger action and sends out a notification once a status code 400 is in the json file.
    This all works.

    My question: What do I have to do so that the trigger not only indicates that there are new files with status code 400, but also passes the content of the json file to the appropriate media type?

    So I want the notification to say the following:

    Problem started at: Placeholder
    Problem name: Status 400
    Host: Host
    Severity: High
    Operational data: (example) 5
    (Example) File Content: id: placeholder, Date: placeholder and so on, the data that is in the json file.


    I have created an item that captures the data but unfortunately I haven't found a way to render it in the trigger.

    Version 6.2 is used and I use for this a http Agent and not an zabbix agent.Click image for larger version

Name:	2022-08-02_17h21_09.png
Views:	1048
Size:	19.2 KB
ID:	449126

    If its not possible, maybe its possible to atleast display the ResponseMessage from the json file?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Enlighten us with your current item and trigger config..

    Comment

    • Zabbix_Julian
      Junior Member
      • Jul 2022
      • 25

      #3
      Hi Cyber,

      thank you for your reply .
      I've created this Item where I receive the needed content from the json file:
      Click image for larger version

Name:	image.png
Views:	900
Size:	29.0 KB
ID:	449170
      Click image for larger version

Name:	image.png
Views:	887
Size:	21.5 KB
ID:	449171





      The test shows me the Infos which I need, I dont have a trigger yet, since I dont know how I should configure it.

      Test:

      Click image for larger version

Name:	image.png
Views:	880
Size:	36.2 KB
ID:	449172

      I would now need a trigger who shows the infos from the "Value", if this is possible.

      Thanks in advance .

      Comment

      • vladimir_lv
        Senior Member
        • May 2022
        • 240

        #4
        Use JSONPath preprocessing to select the number from the JSON

        Comment

        Working...