Ad Widget

Collapse

Create trigger from HTTP Agent item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jvdb
    Junior Member
    • Feb 2022
    • 23

    #1

    Create trigger from HTTP Agent item

    hi,

    i have an http agent item that does an API request to a external server.
    The result is correct that I get from the item:

    {"data":[],"pagination":{"nextCursor":null,"totalItems":0 }}

    Now I want to create a trigger if the following value changes to anything higher than 1
    "totalItems":0

    but I can't seem to figure it out
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2

    Save just the number ($.pagination.totalItems) and then it is easy to make a trigger last(/host/item)>0

    Comment

    • jvdb
      Junior Member
      • Feb 2022
      • 23

      #3
      Originally posted by cyber
      https://www.zabbix.com/documentation..._functionality
      Save just the number ($.pagination.totalItems) and then it is easy to make a trigger last(/host/item)>0
      The saving just the number, how do I do this?

      Comment

      • kaiszy
        Junior Member
        • Nov 2024
        • 3

        #4
        Hi,

        i think in your item you have

        Type of Information: Numeric (float)

        then goto the Tab preprocessing

        Add step =>
        Name: JSONPath,
        Parameter: $.pagination.totalItems


        and return it as number. Then you can use the above trigger with that item.

        I hope this helps

        Best regards,
        Kai.

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #5
          Exactly! Clicking on that link should give some hints... And reading on preprocessing...

          Comment

          • jvdb
            Junior Member
            • Feb 2022
            • 23

            #6
            thanks guys, I just figured it out

            Comment

            Working...