Sending SMS notifications to IBM Cloud Event Notifications
In this tutorial, you learn how to set up IBM Cloud® Monitoring to send alert notifications to IBM Cloud Event Notifications. For this tutorial IBM Cloud Event Notifications is configured to send SMS notifications to subscribers.
SMS messages can only be sent to phone numbers in the United States and Canada.
IBM Cloud Event Notifications supports message concatenation so SMS messages longer than 160 characters can be sent. However, messages will be sent in blocks of at most 160 characters. Multiple messages might result in additional charges to the recipient.
In this tutorial you will configure the following flow:
- An alert is raised in IBM Cloud Monitoring.
- IBM Cloud Monitoring sends a notification to IBM Cloud Event Notifications.
- IBM Cloud Event Notifications creates an SMS message and sends the SMS message to the subscribed user.
Before you begin
Your IBM Cloud Monitoring instances can send events to IBM Cloud Event Notifications instances in the same account and in other accounts. IBM Cloud Event Notifications is available in a limited number of regions.
For this tutorial, make sure you have an IBM Cloud Monitoring instance configured and collecting logs in a region where IBM Cloud Event Notifications is supported such as us-south
.
Log in to IBM Cloud
Log in to your IBM Cloud account.
-
Click IBM Cloud dashboard to launch the IBM Cloud dashboard.
-
Log in with your user ID and password. The IBM Cloud Dashboard opens.
Create an IBM Cloud Event Notifications service instance
First, create an IBM Cloud Event Notifications service instance by doing the following:
-
Click Catalog.
-
In Search the catalog enter Event Notifications.
-
In the Create tab enter:
- For Select a location select
Dallas (us-south)
. - For Select a pricing plan select
Lite
. - For Service name enter a name of your choice. For example:
my_event_notifications
. - For Select a resource group enter your resource group.
- For Select a location select
-
Read and agree to the license agreements.
-
Click Create
Your IBM Cloud Event Notifications instance is created and is displayed.
Configure permissions
To grant an instance of the IBM Cloud Monitoring service access to an instance of the IBM Cloud Event Notifications service, you must define an authorization where the source service is set to IBM Cloud Monitoring and Resources based on selected attributes; the target service is set to IBM Cloud Event Notifications and Resources based on selected attributes; and the service access includes both Reader and Event Source Manager access.
- Click Manage > Access (IAM).
- Click Authorizations.
- Click Create.
- For Source service select IBM Cloud Monitoring.
- For How do you want to scope the access? select All resources.
- For Target service select Event Notifications.
- For How do you want to scope the access? select All resources.
- For Service access make sure Reader and Event Source Manager are selected.
- Click Authorize.
For more information on how to define authorizations, see Using authorizations to grant access between services.
Configure a notification source in IBM Cloud Event Notifications
To create a notification source in IBM Cloud Event Notifications you will make the configuration change in IBM Cloud Monitoring. When you create the notification channel in IBM Cloud Monitoring it will be available automatically in IBM Cloud Event Notifications.
-
Click the menu icon
-
In the navigation menu, select Observability.
-
Select Monitoring.
The list of instances that are available on IBM Cloud is displayed.
-
Select an instance in the
us-south
region. Then, click Open dashboard.The Web UI opens.
-
In the navigation click the circle icon with your initials.
-
Click Settings.
-
Click Notification Channels.
-
Click Add Notification Channel.
-
Select IBM Event Notifications.
-
For Event Notifications Instance select the IBM Cloud Event Notifications you created.
-
For Channel Name give your channge a unique name. For example,
my_event_notification_channel
. -
For this tutorial leave all options enabled and the Shared With team as the default value.
-
Click Save.
-
Click the menu icon > Resource list.
-
Open Services and software.
-
Open the IBM Cloud Event Notifications instance you created. For example,
my_event_notifications
. -
Click Sources.
When you configure the channel in Monitoring, a source, with the same name as your Monitoring instance name, is automatically added to your IBM Cloud Event Notifications Sources list.
Create an IBM Cloud Event Notifications topic
Next you will define an IBM Cloud Event Notifications topic that will receive the notification from IBM Cloud Monitoring.
-
Click Topics.
-
Click Create. The Topic details panel opens.
-
In the Topic details enter the following:
- Enter the Name for your topic. For example,
MyMonitoringTopic
. - For Source select the IBM Cloud Event Notifications source, which is named the same as your IBM Cloud Monitoring instance.
- Select an Event Type. For this tutorial select Alert.
- Select an Event subtype. For this tutorial select Metric.
- Select a Severity. For this tutorial select Info Severity.
- Enter the Name for your topic. For example,
-
Click Add a condition.
If you do not click Add a condition before you click Create, the topic will be created with no conditions associated with it.
-
Click Create. Your topic will be displayed in the Topics list.
Create an IBM Cloud Event Notifications destination
In this step you will make sure that an SMS destination exists where notifications will be forwarded.
-
Click Destinations.
-
Notice in the Destinations list that, by default, there is an IBM Cloud SMS service defined. You do not need to do anything else to configure an SMS destination.
If you wanted to add a webhook as a destination, you would click Add and provide the appropriate information in the Add a destination panel.
Create an IBM Cloud Event Notifications SMS subscription
In this step you will configure who will receive an SMS message when a notification is processed.
-
Click Subscriptions.
-
Click Create. The Create a subscription panel opens.
-
In the Create a subscription panel enter the following:
- Enter the Name for your subscription. For example,
MyMonitoringSubscription
. - For Topic, select the topic you created. For example,
MyMonitoringTopic
. - For Destination, select
IBM Cloud SMS service
. - For Recipients, enter up to 100 phone numbers to receive SMS messages. Phone numbers must be specified as a
+
followed by the country code and full number specified without dashes. For example,+19999999999
. Only phone numbers in the United States and Canada can be specified.
- Enter the Name for your subscription. For example,
-
Click Create. Your subscription will be added to the Subscriptions list.
Create an IBM Cloud Monitoring alert notification
Now, create an IBM Cloud Monitoring alert that will trigger the IBM Cloud Event Notifications notification.
-
Click the menu icon .
-
In the navigation menu, select Observability.
-
Select Monitoring.
The list of instances that are available on IBM Cloud is displayed.
-
Select the IBM Cloud Monitoring instance that you configured to send notifications to IBM Cloud Event Notifications.. Click Open Dashboard.
-
Click Alerts.
-
Click Add Alert.
-
Create an alert that meets the criteria of the IBM Cloud Event Notifications topic that you created.
-
Click Metric.
-
For the new alert specify the following:
- For Name specify
MyEventNotificationAlert
. - For Severity specify
Info
. - Define a metric for you system that you know will trigger an alert.
- Enable the
myEventNotificationChannel
for the alert.
- For Name specify
-
Click Create.
-
Next steps
You should start receiving SMS notifications at the phone numbers that you configured whenever the criteria defined in both IBM Cloud Monitoring and IBM Cloud Event Notifications match.