Ad Widget

Collapse

Custom http post on "Problem acknowledgment"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galvy
    Junior Member
    • Jun 2020
    • 19

    #1

    Custom http post on "Problem acknowledgment"

    Good morning everyone,
    I'am creating a template to monitor TrueNas using its APIs instead of SNMP. Once it's ready, I will publish it on GitHub for the community
    I make an HTTP call, parse the JSON, and generate the items and their respective triggers.
    Is there a way to perform an action when an operator acknowledges a trigger?
    The basic idea is as follows: when an operator acknowledges an event in Zabbix, it should make a POST call to TrueNAS to mark the event as acknowledged(TrueNas Api) so it can be deleted in the next scan performed by Zabbix.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    I think acknowledge should fall under "update operation". so you should be able to configure it under your action...

    Comment

    • galvy
      Junior Member
      • Jun 2020
      • 19

      #3
      I found "update operation" but for me to be honest is not clear how to use it.

      Comment

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

        #4
        Same way as starting or recovery operations... Define some media, that you can "send message to"... webhook or script, that will use your data to do some "action", in your case it needs to "make a POST call to TrueNAS to mark the event as acknowledged".

        Comment

        • galvy
          Junior Member
          • Jun 2020
          • 19

          #5
          Thank you for your suggestion, now I'm understanding how to use it.Is there a way to retrieve the MACRO variables defined on the host and other variables like HOSTCONN to use them as parameters? I have created a template with the ApiKey and I need to use it to make the HTTP call.

          Comment

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

            #6
            Originally posted by galvy
            Thank you for your suggestion, now I'm understanding how to use it.Is there a way to retrieve the MACRO variables defined on the host and other variables like HOSTCONN to use them as parameters? I have created a template with the ApiKey and I need to use it to make the HTTP call.
            There are message templates for each media, what you can use. Or just write all necessary stuff into "message" field in action config. Your "media" just needs to parse that message for necessary data and use it for external call...
            You can use any of macros, that have "Problem update notifications and commands" in "supported in " field here https://www.zabbix.com/documentation...ed_by_location

            Comment

            Working...