Custom Webhook messages

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.

ParameterDescriptionExample
{{alert-id}}Id of the alert1234
{{alert-name}}Name of the alertDisk space alert
{{alert-target-name}}Name of the alert targetlocalhost\sql2019
{{alert-status}}Status of the alertRaised
{{alert-severity}}Severity of the alertHigh
{{alert-url}}Alert details Url of the alerthttp://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.


Do you have any feedback on this documentation?

Let us know at sqlmonitorfeedback@red-gate.com


Didn't find what you were looking for?