Create multi-channel alerts
Learn how to create multi-channel alerts in Cloud Management Platform (CMP) for email, Slack, and Microsoft Teams
3 minute read
When CMP is first set up, tracked events include administrative events, such as changes to environments, and security events, such as user login attempts. You can also define new event classes and route them to their own channels via CMP actions.
Send an alert to the vCenter admin Slack channel whenever a provisioning failure occurs in any vCenter-backed environment. CMP includes channels for email, Slack, and Microsoft Teams.
To configure multi-channel alerts, first create an alert channel, then associate it with one or more alert categories. When an alert is sent to a category, CMP routes the notification to every alert channel associated with that category.
For example, if the built-in cloudbolt.security category is associated with both an email alert channel and a Slack alert channel, any alert in that category is delivered as a Slack message to the Slack channels defined on the Slack alert channel and as an email to the recipients defined on the email alert channel.
To add, edit, or delete alert channels, go to Admin > Multi-Channel Alerts. The table displays the most important details of each configured channel, with additional type-specific details in the edit form.
When you add an alert channel, you choose a type and are directed to the corresponding form.
Enter alert categories in these forms as a comma-separated list. There is currently no mechanism to ensure that the categories associated with a channel match the categories to which alerts are actually sent.
Some alerts are sent automatically as events occur, such as a user logging in. There are two built-in alert categories:
The cloudbolt.security category covers user login, permission changes, requests for console access to a VM, user creation or deletion, and password resets or changes.
The cloudbolt.admin category covers events that might change system functionality. These include creation, deletion, and changes that merit history events for resource handler, environment, and blueprint objects, as well as the creation, deletion, or renaming of a group.
If no alert channels are configured for a category, its alerts do not send notifications.
When you write custom code for CMP, such as an action or recurring job, you can send your own custom alerts. Define your own categories and associate them with alert channels to control where the alerts are sent.
The API for issuing alerts from your CMP plugins is straightforward:
alert() function is available from the alerts.methods module and can send any message through multi-channel alerts.from alerts.methods import alert
def run(job, **kwargs):
alert(
message='Something good has happened',
category='example.good_news'
)
alert(
message='Something bad has happened',
category='example.bad_news'
)
return '', '', ''
Then configure one or more alert channels associated with these categories to start sending Slack messages or emails.
Learn how to create multi-channel alerts in Cloud Management Platform (CMP) for email, Slack, and Microsoft Teams
Create a Slack app and connect it to Cloud Management Platform (CMP) so multi-channel alerts post to a Slack channel
Set up multi-channel alerts to post to a channel in your company’s Microsoft Teams