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 eitherBasic
followed by the base64-encoded string for the username and password, orBearer
followed by the bearer token. For example,Property Value Header Name Authorization
Header Value Basic Base64_encoded_string_for_username_and_password
orBearer bearer_token
Email Alert Webhooks are created after you configure SMTP settings. See Configuring SMTP Settings.
Procedure
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.
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
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
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
Results
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.