Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
shraddhashetty
Product and Topic Expert
Product and Topic Expert

Introduction


SAP Alert Notification service for SAP BTP offers a common API for providers to publish alerts and for consumers to subscribe to these alerts. It is designed to send automatically real-time notifications and alerts about events that may be of interest to the business and operations.

Read more on SAP Alert Notification Service

Purpose


This blog explains about

  • Subscribe to alert notification service in BTP Cockpit.

  • Creating a Disk Usage Alert.

  • Creating Actions i.e. Email & Teams Notification


Subscribe to alert notification


Go to your space and click on instances. Click on create and select Alert Notification as Service.


Choose standard plan and instance name for the service.


Skip the next step, then create the subscription. Once created, open the instance by clicking on it.


 

Create a Subscription for Disk Usage Alerts


In your alert notification service, go to subscription, click on create.


 

Enter the Subscription name and click create, Next you have to create the conditions. You can create a more than one conditions for your subscription. Also, have the mandatory field checked for better results.



When you create the condition with respect to the eventType, check the SAP HANA Cloud Service Database Events


You can create few more conditions to filter the alerts.


 


Now, once all the desired conditions are created, you can select all the conditions needed for a particular condition at once. These conditions will be visible as available conditions when ever a new subscription is created.


Once assigned, Create action for your subscription.

Create Actions


 1.  Create a action for Email




Enter the name and the description.


Enter the email address where you want to send the alerts related to the disk usage subscription.


Click on create, the action will be visible on the available actions. Select and click next. Review the summary of the subscription and click on close.



2. Create an action for Teams Channel


In order to receive the notification on Microsoft teams, you have to configure the Incoming Webhook.

Create a channel in your teams where you want to receive the notifications for the alerts.


Go to General, select the connectors, look for incoming webhook, add the incoming webhook. Click on confígure.




Add a name to the webhook and click on create.


Copy the URL and save it. You need this URL to add it to action in our alert notification subscription.


Connection to the incoming webhook has been set up.



Now you can go to the subscription and add a new action item called 'Send2Teams'.


Add the webhook URL in the field and create the action.


 

Add this action to the DiskUsageEvent subscription


 

 

Test the action


We can test the subscription by sending the test event. Replace the existing JSON and add the parameters that match the conditions of the subscription.

Note : JSON has to be edited in a text editor and then add it to the sample test event.


 

Copy the below to a text editor and add the matching condition to the same as shown below in VS code.



Send the test event.


Now, you will receive an email with all the details such as type, category and severity etc.


 

Also, you will receive a teams notification on the Alerts channel.



Test via Alert Definition


In the SAP HANA Cockpit. go to the alert definitions and select disk usage. Adjust the Thresholds for Prioritized Alerting as shown below and click on Check now.


 

You will receive the email & teams notification for the same.

You can try the same steps for other events that's defined in SAP Alert Notification Service Events.

Please share your feedback !


 

 

 

 

 

 

 

 

 

 
10 Comments
Blume
Explorer
Hi Shraddha Shetty,

That's a very described and complete article about the SAP Alert Notification Service.
Kudos for the nice work and the contribution.

Thank you very much!

All the best,
Vini
Martin-Pankraz
Active Contributor
0 Kudos

Thanks for sharing shraddhashetty! How about closing the loop once you pushed the notification?

That "ping" on Microsoft Teams will spark a follow up task. In case it requires an action on BTP a simple jump target on that adaptive card that you shared in the second to last screenshot goes a long way.

Even better is more complex integration enabling BTP API calls to increase disc space from that adaptive card to stick with your sample. The pattern is applicable to any alert scenario with follow up action. We advocate not to stop at the message but offer integration to automate the following tasks fostering true automation. And closing alerts once consumed.

Alerting is not enough nowadays in my opinion.

KR

Martin

BiserSimeonov
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi martin-pankraz !

You comment about extending the use case and brining an automated (remediation) action is straight to the point and I would like to suggest checking out SAP Automation Pilot.The primary goal of SAP Automation Pilot is to simplify and automate complex manual processes in order to minimize the operational effort behind any cloud solution in the SAP Business Technology Platform. By using the means of its minimalistic model, you can automate a sequence of steps executable by a machine. The service is designed to work with low latency even when it is under a heavy workload.

I share also a quick overview about SAP Automation Pilot capabilities:


Here it is a link to the help documentation as well.

Moreover, I share a quick overview about some possible use cases:


 

Of course, in case of any possible questions / comments from your side - please just ping me or write to me directly at biser.simeonov(at)sap.com

 

Kind regards,

Biser

 
Martin-Pankraz
Active Contributor
0 Kudos
Hi Biser,

Conceptually that is what I was talking about. However, the Automation Pilot region coverage is rather sparse. Azure PaaS is available in any region with serverless consumption patterns.

Nevertheless, great for customers to choose the automation path and workflow engine that fits their requirements best.

KR

Martin
venky
Discoverer
0 Kudos
Hi Shraddha ,

Thanks for a Good Blog .Can you please tell me -

  1. If there is a way we can Automate the Event Triggered Mechanism ?

  2. Can we Customize the Test Event ?

  3. Can you add More Links for this Like similar kind of Approaches for Implementing in CPI as well ?


Regards

Venkatesh
Dan_vL
Product and Topic Expert
Product and Topic Expert
The following tutorial provides an example of executing a SQL query in a Python Script in the SAP Automation Pilot and then triggering an Alert Notification Service alert based on the results of the query.  I hope that helps further.

Execute SQL Commands and Create Custom Notifications with SAP Automation Pilot and SAP Alert Notific...

Regards,
Dan
dirugadr
Participant
0 Kudos

Hi! Great post!

I have a question, regarding the email action behavior: is it possible to include more than one email address in the action? I have to notify a group about some events, but I could not set the field with another value than just one email address.

Thank you in advance

Dan_vL
Product and Topic Expert
Product and Topic Expert

One option would be to create a second action that emails a second email address.  I believe multiple actions can be added to a subscription.  I think for emailing a group, this would be best handled by the creation of a distribution list or dl with your company email.

dirugadr
Participant
0 Kudos

Thank you Dan,

Yes, I created a second action that works, but it forces me to replicate the email properties (subject and body). It's not a big deal, but it could be more flexible if more than one email address can be used in one action. I have to test using a distribution list, anyway.

 

BorisZarske
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Dirugadr,

As far as I know, a single event should be able send an alert to up to 100 recipients, but recommendation is really to create an email group or distribution list on your side. The benefits are that just one confirmation is needed in order to activate the action type for all recipients (so you prevent that each recipient will have to confirm reception of corresponding notification emails) and that you can deliver notifications to more than 100 recipients. Please also see this question: Adding Distribution List in Alert Notification Ser... - SAP Community

Best regards,
Boris