Ad Widget

Collapse

Display value in the Problem board which is not related to the trigger value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ninroot
    Junior Member
    • Jan 2019
    • 5

    #1

    Display value in the Problem board which is not related to the trigger value

    Hi,

    I am new with Zabbix 4.0. I need to monitor an application that provides a homemade script. It returns the status and the message in JSON format.

    Example:
    {
    "status": "Warning",
    "message": "Foo cannot do such thing because bar is not aligned with the stars",
    }


    or

    {
    "status": "Nothing",
    "message": "Everything is good",
    }


    Base on this JSON, I want to generate a Problem that displays the field "message".
    With a good regex of the status field, the triggering of the alert can be done but I don't know how to get the field message to be display on the board of Problems.

    Any suggestions? Thanks!
  • Ninroot
    Junior Member
    • Jan 2019
    • 5

    #2
    Hi,

    I created an item that get the JSON format with SSH. A trigger create an alert base on a regex.
    The name of the trigger seem not working with such expression:

    Test {HOST.NAME} json {MyTemplate:ssh.run[testkey]}

    Is there any work around to get value of the message in the trigger name or in the description?

    Comment

    • Ninroot
      Junior Member
      • Jan 2019
      • 5

      #3
      After playing with the item, trigger and macros configuration I was able to get the message in the trigger named by doing this following configuration:
      1. The item get the complete json without preprocessing
      2. The trigger raise an alert based on regex
      3. The trigger name is displayed by using a macro ITEM.VALUE with regex macro fonction

      Comment

      Working...