Alerting via Webhook Contact

About Webhook

Webhooks are user-defined HTTP/s callbacks. In Monitis they can be configured to trigger alerts. When an alert occurs, Monitis makes an HTTP/s request to the URL configured for the Webhook. With Webhooks you can get data with both GET and POST methods in the following formats: JSON, XML, Query string.

To use Webhook in Monitis you need to add a Webhook contact. Once an alert via Webhook is sent, you can parse the request and use the alert params (metrics, values, etc.) for different types of a trigger-like functionality for configuring post-alert actions on your side.

Adding Webhook Contact

To add a new Webhook contact, go to the Alerts top menu.

Contacts

Click Contacts.

The Contacts window will open.
All_Contacts_

Click the New Contact button.

The New Contact window will open.
New_Contact

Enter the First Name and Last Name for the contact.

Select Webhook from the Contact Type combo box.

Provide the destination URL for webhooks under the Webhook URL.

Select the Request Type: POST or GET.

Select the Data format: JSON, XML or Query string.

Select the Contact Group for the new contact.

Select the Time Zone for the contact.

Check the Enable Sensitive Alerting box if you want to enable it. See here about Sensitive Alerting.

Click Next.

You will be taken to the Alert Rules tab.

Alert_Rules_

If you do not want this contact to receive alerts, click Don’t Receive Alerts for now.

Click Custom Configuration (Advanced) to configure alerts if you want this contact to receive alerts (see Alert Rules).

Click OK.

You will be shown a message asking to confirm the new Webhook contact.
Confirm_Contact

Follow the instructions below to confirm your Webhook contact.

Confirming Webhook

As soon as you add a Webhook contact we send a confirmation link by GET method to your provided URL with a ”confirmationURL” param in it.

Below is the structure of the confirmationURL param:

“http://monitis.com/confirmation/userkey/confirmContact/contactId/code”

Just visit the link or send it by GET request to confirm the contact.

You will see a confirmation message in your browser.
Webhook Confirmation

If you need to resend the confirmation link, use the Resend button in the Contact Confirmation pop-up window.

Note: For as long as you haven’t confirmed the contact, you can open the Contact Confirmation pop-up window by clicking the warning icon next to the contact in the contact list.

Confirm_Contact.1

The confirmation link will expire as soon as clicked (contact confirmed). If you click it again, you will see the respective message on the screen.Expired

Language Support

Alerting via Webhook is currently available in English only, independent of the set dashboard language: regardless of what language you select in dashboard, you will receive Webhook alerts in English.

Monitor Metrics List

You may want to implement some logic on your side to run it following receiving the alert, as this is what Webhook is best for. For instance, you may wish to terminate programmatically some process or maybe reboot your server if CPU load crosses your predefined threshold. For that, you will need to know in advance the exact names of the monitor metrics to have your code listen for them in the received alerts. You can find the full metric list per monitor type under Monitor Metrics.

Migration from URL Callback to Webhook

The new Webhook contact type replaces the current URL callback type.

Current plain text format used in the now deprecated URL callback contact type will be supported for the existing contacts until you edit them by changing the data format to XML, JSON or Query string. Once you do that your URL Callback contact will be converted into Webhook and you will no longer be able to receive alerts in plain text format.