Custom Webhook messages
Published 17 August 2020
You can set a custom Webhook message to be sent whenever any alert begins, escalates, de-escalates or ends. This is necessary to integrate with some third-party tools that require a specific JSON format, such as Microsoft Teams. An example message to be used for Microsoft Teams is shown below.
Custom message parameters
The following parameters can be used within a custom message.
Parameter | Description | Example |
---|---|---|
{{alert-id}} | Id of the alert | 1234 |
{{alert-name}} | Name of the alert | Disk space alert |
{{alert-target-name}} | Name of the alert target | localhost\sql2019 |
{{alert-status}} | Status of the alert | Raised |
{{alert-severity}} | Severity of the alert | High |
{{alert-url}} | Alert details Url of the alert | http://sql-monitor/Alerts/localhost/Details/4521988?asOfTicks=637200269761573800 |
Using custom Webhook messages to integrate with Microsoft Teams
Custom Webhook messages can be used to send alert notifications to Microsoft Teams using connectors. An example custom message to be sent to the URL of the Microsoft Teams installation is shown below.
{ "@context": "http://schema.org/extensions", "@type": "MessageCard", "summary": "SQL Monitor Alert [{{alert-id}}] - {{alert-name}}", "sections": [{ "activityTitle": "SQL Monitor Alert [{{alert-id}}] - {{alert-name}}", "activitySubtitle": "Reported on {{alert-target-name}}", "activityImage": "", "facts": [{ "name": "Status", "value": "{{alert-status}}" }, { "name": "Level", "value": "{{alert-severity}}" }], "markdown": true }], "potentialAction": [{ "@type": "OpenUri", "name": "View Alert", "targets": [ { "os": "default", "uri": "{{alert-url}}" } ] }] }
This will result in the following type of notification being received within Microsoft Teams. You can adjust the custom message to change the information sent and subsequently shown within Microsoft Teams.