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-raised-time}}When the alert was originally raised2022-10-12 17:46:30.2567915Z
{{alert-event-time}}When this event occurred (different to the raised time for Escalated, DeEscalated, or Ended alert-status types)2022-10-12 18:02:12.1651874Z
{{alert-url}}Alert details Url of the alerthttps://sql-monitor/Alerts/localhost/Details/4521988
{{base-monitor-guid}}Guid identifying the Base Monitor servicea1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6

Uniquely identifying alerts

Sometimes it will be helpful to uniquely identify a SQL Monitor alert in another system. An {{alert-id}} is guaranteed to be unique to a single Base Monitor, but is not unique across multiple Base Monitors. To uniquely identify an alert globally in an environment which is fed alerts by multiple Base Monitors, use the combination of {{base-monitor-guid}} and {{alert-id}}.

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?