Ad Widget

Collapse

Using host group info in webhook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • martr
    Junior Member
    • Jan 2023
    • 1

    #1

    Using host group info in webhook

    We are using Zabbix in a multi-customer environment (providing managed services). We are using host groups to designate which customers different hosts belong to. We would like to integrate a 3rd party helpdesk by sending http requests via Zabbix webhook, whenever certain events take place on hosts (as described here: https://www.zabbix.com/documentation.../media/webhook).

    We're trying to include the Zabbix host group info in the webhook calls so that our helpdesk would know, which customer the host belongs to that triggered an event. Which input parameter should we use to have the host group info available in the webhook?

    There seems to be an HOSTGROUP.ID macro, but I'm not sure whether it's available for triggered events (https://www.zabbix.com/documentation...ed_by_location). Furthermore, it would be better to have the actual host group name available, instead of some non-descriptive ID.
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    {TRIGGER.HOSTGROUP.NAME}

    Comment


    • martr
      martr commented
      Editing a comment
      It seems to be exactly what we need, although I haven't tested it yet. Thank you!
  • coda_matt
    Junior Member
    • Nov 2022
    • 20

    #3
    Is it possible to filter on that? So only certain hostgroups trigger the webhook?

    Comment

    • fvilarnovo
      Junior Member
      • Jan 2023
      • 17

      #4
      Hello, an approach to what you are trying to achieve could be using conditions in the trigger action:



      So in order to execute the webhook, the event must belong to certain hostgroup, and event severity higher than... following the logic that suits better.

      Other (and probably better option) would be the use of tags with the same logic. Instead of specify each hostgroup in conditions, you could use a tag like "notifications: webhook". and match that once.

      Hope it helps.

      Comment

      • coda_matt
        Junior Member
        • Nov 2022
        • 20

        #5
        That's perfect, fvilarnovo, thank you!

        Comment

        Working...