VMware Data Services Manager uses database status as a criteria to reflect the availability of the database, to identify an in-progress operation or to notify a critical operation that failed. The status of a database is also affected by alerts that VMware Data Services Manager may trigger for the database.

These alerts can be sent as email notifications or as other notifications to any customised application, such as Slack channels or ServiceNow. VMware Data Services Manager uses Webhooks to connect to an external application and send alert notifications for databases provisioned in VMware Data Services Manager.

Only a DSM administrator can configure and update Webhooks in VMware Data Services Manager. DSM users can associate or dissociate Webhooks for the databases they create.

Creating Webhooks

As a DSM administrator, you can create Webhooks that can be associated with the databases created in VMware Data Services Manager.

When you configure authentication, keep in mind the following:

  • For basic authentication with the server, you should supply values for Authorization User and Authorization Password.
  • If you prefer supplying a base64-encoded string or a bearer token, use Custom Headers. Specify the Header Name as Authorization and the Header Value as either Basic followed by the base64-encoded string for the username and password, or Bearer followed by the bearer token. For example,
    Property Value
    Header Name Authorization
    Header Value
    Basic Base64_encoded_string_for_username_and_password
    or Bearer bearer_token
Note:

Email Alert Webhooks are created after you configure SMTP settings. See Configuring SMTP Settings.

Procedure

  1. Select Settings from the left navigation pane.
  2. Click Webhook Settings tab.
    The Webhooks list appears.
  3. Click NEW WEBHOOK SETTINGS.
  4. In the Name and Destination tab of the Create New Webhook form, set the following properties.
    Property Description
    Endpoint Type Select Slack, ServiceNow, or Custom as the endpoint application from the dropdown list. You can select Custom if you want to configure any other application as the endpoint type other than Slack or ServiceNow.
    Webhook Name Enter a unique name of the Webhook.
    Destination URL Enter the destination URL of the endpoint application.
    System Alerts Check if you want to configure a webhook for system alerts.
    HTTP Request Method Select POST or PUT from the dropdown list.
    Authorization User Enter the authorization username for the Webhook.
    Authorization Password Enter the authorization password for the Webhook.
    Custom Headers Enter the Header Name and Header Value for the custom header of the Webhook. Click + to add more custom headers and - to remove custom headers.
    Note: If you select Slack as the Endpoint Type, you need not provide Authorization User, Authorization Password*, and Custom Headers because authorization token is provided in the Webhook URL that is generated for Slack.
  5. Click NEXT.
  6. On the DB Alert Payload page of the Create New Webhook form, set the following properties.
    Property Description
    Content Type From the dropdown list, select JSON or XML as the content type of the Webhook for a database alert. You can only choose JSON if you have selected Slack as the Endpoint Type in the Name and Destination tab because Slack doesn't support XML as an option for Content Type.
    Webhook Payload

    Use the payload as-is or update the Webhook's payload, as required. VMware Data Services Manager supports only the parameters listed in the Parameters box to be included in the payload. For more information, see Webhook Payloads.

    You can click TEST below the left side of the Parameters box to test the payload that is triggered by the Webhook due to a database alert. Click TEST to send the payload to the configured endpoint URL.

  7. Click NEXT.
  8. In the DB Operation Failure Payload page, set the following properties.
    Property Description
    Content Type From the dropdown list, select JSON or XML as the content type of the Webhook for any database operation failure. You can only choose JSON if you have selected Slack as the Endpoint Type in the Name and Destination tab because Slack doesn't support XML as an option for Content Type.
    Webhook Payload

    Use the payload as-is or update the Webhook's payload, as required. VMware Data Services Manager supports only the parameters listed in the Parameters box to be included in the payload.

    You can click TEST below the left side of the Parameters box to test the payload that is triggered by the Webhook due to database operation failure. Click TEST to send the payload to the configured endpoint URL.

  9. Click NEXT.
  10. If you configured System Alerts, in the System Alert Payload page, set the following properties.
    Property Description
    Content Type From the dropdown list, select JSON or XML as the content type of the Webhook for any database operation failure. You can only choose JSON if you have selected Slack as the Endpoint Type in the Name and Destination tab because Slack doesn't support XML as an option for Content Type.
    Webhook Payload

    Use the payload as-is or update the Webhook's payload, as required. VMware Data Services Manager supports only the parameters listed in the Parameters box to be included in the payload.

    You can click TEST below the left side of the Parameters box to test the payload that is triggered by the Webhook due to database operation failure. Click TEST to send the payload to the configured endpoint URL.

  11. Click CREATE.

Webhook Payloads

VMware Data Services Manager supports JSON and XML payloads for Slack, ServiceNow, and Custom Webhooks. You can edit the payloads using the supported parameters, as required. When VMware Data Services Manager sends the database alerts, the string values of the parameters are automatically replaced by values of the Webhook that you configure. However, you need to enter the static values of the parameters when you configure a Webhook.

Note: Slack does not support XML payloads to configure Webhooks.

Example of a JSON Webhook's payload for Slack for database alert is as follows:

{
    "attachments": [
        {
            "author_name": "[Alert] VMware Data Services Manager > Alert Notification > ${ClusterName}",
            "color": "#D02927",
            "footer": "VMware DSM",
            "ts": "${Timestamp}",
            "fields": [
                {
                    "title": "Cluster Name",
                    "value": "${ClusterName}"
                },
                {
                    "title": "Node/Pod Name",
                    "value": "${InstanceName}"
                },
                {
                    "title": "Created Time",
                    "value": "${CreatedTime}"
                },
                {
                    "title": "OwnerEmail",
                    "value": "${OwnerEmail}"
                },
                {
                    "title": "Alert Name",
                    "value": "${AlertName}"
                },
                {
                    "title": "Alert Level",
                    "value": "${AlertLevel}"
                },
                {
                    "title": "Alert Description",
                    "value": "${AlertDescription}"
                },
                {
                    "title": "Alert Time",
                    "value": "${TriggeredAt}"
                },
                {
                    "title": "Alert Message",
                    "value": "${AlertMessage}"
                },

                {
                    "title": "Database Cluster Identifier",
                    "value": "${ClusterId}"
                }
            ],
            "actions": [
                {
                    "type": "button",
                    "text": "See more",
                    "url": "${Url}"
                }
            ]
        }
    ]
}

Example of a JSON Webhook's payload for ServiceNow for database alert is as follows:

{
    "short_description": "[Alert] VMware Data Services Manager > Alert Notification > ${ClusterName}",
    "description": "Alert: ${AlertName} with level: ${AlertLevel} triggered on cluster/instance: ${ClusterName} owned by ${OwnerEmail}.",
    "close_code": "NO_RESOLUTION_PROVIDED",
    "close_notes": "STATIC CONTENT"
}

The different parameters that you can configure in a payload of a Webhook for the database alert include, but are not limited, to the following:

Parameter Description
TargetType Database instance
TriggerType Database alert or failure of a database operation
Url

VMware Data Services Manager URL of the target database cluster

ProductUrl

VMware Data Services Manager URL

Timestamp Notification timestamp that includes the date and time in yyyy-MM-dd-THH:mm:ss format
ClusterName Database cluster name
ClusterId Database cluster ID
OwnerEmail Database owner email
CreatedTime The time at which the database is created in the yyyy-MM-dd-HH:mm format
InstanceName Name of the database instance
DBName Name of the database
AlertName Name of the alert for CPU Health, Data Disk Health, System Disk Health, and so on
AlertLevel Level of the alert, that is, CRITICAL or WARNING
AlertDescription Description of the alert
AlertMessage Detailed message about the alert
CurrentStatus Current status of the database
TriggeredAt The date and time at which the alert is triggered in the yyyy-MM-dd-HH:mm format
TriggeredDate The time at which the alert is triggered in the yyyy-MM-dd format
TriggeredTime The time at which the alert is triggered in the HH:mm:ss format

The different parameters that you can configure in a payload of a Webhook for the failure of a database operation include, but are not limited, to the following:

Parameter Description
TargetType Database instance
TriggerType Database alert or failure of a database operation
Url

VMware Data Services Manager URL of the target database cluster

ProductUrl

VMware Data Services Manager URL

Timestamp Notification timestamp that includes the date and time in yyyy-MM-dd-THH:mm:ss format
ClusterName Database cluster name
ClusterId Database cluster ID
OwnerEmail Database owner email
CreatedTime The time at which the database is created in the yyyy-MM-dd-HH:mm format
InstanceName Name of the database instance
DBName Name of the database
TriggeredAt The date and time at which the alert is triggered in the yyyy-MM-dd-HH:mm format
TriggeredDate The time at which the alert is triggered in the yyyy-MM-dd format
TriggeredTime The time at which the alert is triggered in the HH:mm:ss format
TriggeredUserEmail Email ID of the user who triggers the database operation
TaskStatus Status of the task
PreviousStatus Previous status of the database
TaskType Tyoe of the task that triggers the notification

Editing Webhooks

After creating a Webhook, you may need to update the payload to add, modify, or remove parameters of the payloads. Else, you may need to update a Webhook's name, authorization credentials, and so on.

Procedure

  1. Select Settings from the left navigation pane.
  2. Click the Webhook Settings tab.
    The Webhooks table appears.
  3. From the table, identify the Webhook that you want to update click the three vertical dots in the Actions column of that Webhook, and click Edit.
    The Edit Webhook form appears.
  4. Follow the prompts to update appropriate properties, and click UPDATE.

Publishing and Unpublishing Webhooks

The status of a Webhook can either be Published or Unpublished. Notifications of database alert or operation failure are only sent to the published Webhooks. When you create a Webhook, the status of the Webhook is Published. However, you can change the status of a Webhook from Published to Unpublished and vice-versa, as required. If an unpublished Webhook is already associated with a database, that webhook is listed using red font in the Alert Settings tab of that database.

Perform the following steps to change the status of a Webhook.

Procedure

  1. Select Settings from the left navigation pane.
  2. Click the Webhook Settings tab.
    The Webhooks page appears.
  3. From the table, identify the Webhook whose status you want to change, click the three vertical dots in the Actions column of that Webhook, and then click Unpublish or Publish, as required, from the pop-up menu.
    Either the Unpublish Webhook dialog box appears or the status of the Webhook changes to Published.
  4. If the Unpublish Webhook dialog box appears, click CONFIRM.

    The status of the Webhook changes to Unpublished.

Associating and Dissociating Webhooks

Notifications for database alert and operation failure of a database are sent to the published Webhooks associated with a database. After you have created a database, you can activate database alerts and associate the Webhooks with the database. You can later dissociate the Webhooks from the database.

Perform the following steps to activate or deactivate database alerts and to associate or dissociate the Webhooks from a database after you have created the database.

Procedure

  1. Select Databases from the left navigation pane.
    The list of created databases appears in the Databases view.
  2. From the list of databases in the Databases view, click the database for which you want to activate or deactivate database alerts and associate or dissociate Webhooks.
    The Summary tab of the database appears.
  3. Click the Monitoring tab, and click MANAGE ALERT in the Alerts section.
  4. Click EDIT in the Email and Webhooks section.
    The Edit Webhook Alert/Email Alert Configuration dialog box appears.
  5. Select or deselect Enable Alerts for DB Alert to activate or deactivate alerts for the database alert.
    If you activate this alert, you can select Webhooks to be associated with the database, as required. Else, you can cross out the selected Webhooks to dissociate them from the database.
  6. Select or deselect Enable Alerts for DB Operation Failure to activate or deactivate alerts for failure of database operations.
    If you activate this alert, you can select Webhooks to be associated with the database, as required. Or you can cross out the selected Webhooks to dissociate them from the database.
  7. Click CONFIRM.

Results

Note:

You cannot delete a Webhook that is associated with a database. If you want to delete such a Webhook, ensure that it is dissociated from all databases, and then try to delete it.