Icinga Notifications: Use webhook to trigger SMS or Call

Hello :slight_smile:

I started experimenting with the Notifications module and got stuck on using the webhook channel.

The plan was to use that feature to trigger a call or a sms to the on-call person.

SMS Gateway is a Brevis.One, which handles all the information in the called URL.

Example:

https://smagateway/api.php?username=api_access&password=secure&mode=number&to=<number>&text=<text>

or with an added &ring=true to issue a call.

“Hardcoding” everything directly in the URL template works, but nothing with variables like &to=$contact.pager$&text=$host.name$

Were I get stuck is: How do I

  • set the phone number information into the URL template?
  • set the message text to contain host name, service name, state, time (the usual notification info)

Anyone played aroung with something like that already?

Is it something that is even doable in the current state of development?

Module version: v0.2.0

Icinga Web 2 version: 2.13.0

IcingaDB version: 1.4.0

Thanks for posting and trying out Icinga Notifications. Please note that this project is quite new, things are changing and the documentation is still lacking at some points.

Your template URL looks wrong, as the webhook channel uses the Go template engine: Documentation on Webhook Request Body Template Language · Issue #262 · Icinga/icinga-notifications · GitHub

Some time ago I got it to work with SIGNL4 mobile alerting: Icinga | SIGNL4 Docs

I remember it took a while but it worked.

Thank you both for your answers!

Maybe I could use the webhook feature by creating a fitting JSON body for the API call to the gateway.

But what I’m missing is how to get the phone number of the contact that is currently active for the notification to be able to pass it to either the json body or the URL template