SAP HANA Cloud serves as a component in various applications and systems and therefore it is critical for the business operations of numerous organizations. That’s why keeping tabs on the availability of your HANA Cloud instances is crucial for your success. Yet, manually monitoring them, especially when you have multiple instances, can be a tedious and time-consuming task. Wouldn't it be more optimal to have an automated helper keeping a watchful eye for you, alerting you if an instance stops, or better still, starting your HANA instances when they become unavailable?
Welcome to SAP Automation Pilot and SAP Alert Notification Service for SAP BTP – two powerful tools from the SAP Business Technology Platform (SAP BTP) DevOps portfolio. In this blog post, I’m going to walk you through a step-by-step guide on how you can use these innovative tools to transform the way you monitor your HANA Cloud instances, saving you time, preventing potential disruptions, and ensuring your operations continue to run smoothly.
Among the vast array of available tools, SAP Automation Pilot has emerged as a solid and competitive cloud application within the SAP Business Technology Platform (BTP) DevOps portfolio, revolutionizing the way DevOps team streamline their ops processes. In a nutshell, SAP Automation Pilot offers low-code / no-code automation capabilities that allow these teams to automate sequences of ops steps, use catalogs of automated commands provided by SAP or build custom executions (if needed), and run scripts in a serverless manner. More details about the product can be found at:
SAP Alert Notification Service for SAP BTP facilitates your DevOps journey in SAP BTP by providing an API that allows providers to publish and consumers to receive events, and if needed, trigger predefined actions (including sending instant notifications over email, Microsoft Teams, etc.). Working seamlessly across cloud-native and hybrid solutions, it sends real-time notifications on events that are crucial for business and operational efficiency. It not only collects vital technical information from SAP BTP services but also possesses the ability to handle information from custom scenarios within your own environment. In essence, it offers a tailored alerting solution adapted to your needs. More details about the product can be found at:
SAP Alert Notification service for SAP BTP provides an array of built-in events that are ingested from HANA Cloud. (For more information, see SAP HANA Cloud Service Database Events.)
However, these events rely on the availability of the HANA Cloud instance. If this instance suddenly becomes unreachable, it won’t be able to trigger an event and you won’t receive a notification about the problem. For this reason, this use case requires a different approach:
SAP HANA Cloud provides a list of metrics, which are exposed through the metrics service REST API and can be used for monitoring and troubleshooting purposes. This metrics service REST API is a generic central service provided by SAP HANA Cloud which can be used by customers to retrieve metrics from each individual SAP HANA Cloud instance through an external secure API from any HTTPS endpoint. Among the many available metrics within this API, the one that SAP Automation Pilot uses to evaluate the availability of your HANA Cloud instance in this scenario is "HDBAccessible". This metric is gathered at 30-second intervals.
SAP Automation Pilot provides you with a sample command, which calls the HANA Cloud Metrics REST API and gets the data from the “HDBAccessible” metric. If the last 3 pings fail, this means that the HANA Instance is not accessible, and SAP Automation Pilot fires an event to SAP Alert Notification service. If the needed subscription is made in Alert Notification service, the service will send a notification (via email or other delivery channel) to the respective team alerting them that their HANA Cloud instance is unavailable. In the meantime, SAP Automation Pilot will trigger a remediation command, which will start the HANA Cloud instance. The process is visualized in the graphic below:
After you’ve made sure that you meet all the prerequisites, you can proceed with the steps listed below.
1. Verify that you have provisioned SAP Automation Pilot. You should be able to see it in the “Subscriptions” section in your subaccount:
NOTE: SAP Automation Pilot can interact with resources in any BTP landscapes. All you need is to have at least one instance of SAP Automation Pilot.
2. Verify that you have an Alert Notification service instance. You should be able to see it in “Instances” in your space:
3. You need to create a Service Key for your Alert Notification service instance. This key will be used on a later stage by the SAP Automation Pilot command. To create a Service Key, choose the “Create Service Key” option:
4. Enter a name for your service key and choose “Create”:
5. Repeat the previous steps (3, 4) to create a Service Key for your HANA Cloud instance. It will be used on a later stage by the SAP Automation Pilot command.
6. The SAP Automation Pilot team has prepared a catalog with example commands, which can be imported directly into your SAP Automation Pilot instance. Copy the contents of the catalog:
7. Now you need to import the catalog with example commands in your SAP Automation Pilot instance. From the left-side menu, choose “My Catalogs” and then “Import”:
Paste the catalog and choose “Import”:
8. You can see the imported catalog “Automation Pilot Examples” in “My Catalogs”. From this catalog, choose “Commands”:
9. You can see the CheckHanaCloudAvailabilitySample command. You can open the command by clicking on it:
10. When you open the command, you can explore its components – the Input Keys, the Output Keys, and the Executors:
11. Scroll down to “Configuration” and choose the “notifyANS” executor. You need to define the event that SAP Automation Pilot will ingest into Alert Notification service. To do that, choose “Edit” to enter the properties of your event:
12. You can use these example values for the required event properties of your event:
13. After you have done that, trigger the command:
14. You need to provide values for the following input keys:
You can also look at the prepared outputs (no need to provide values for them but it is important to understand what data is returned as the command's output):
15. Provide values for all input keys and then trigger the command:
There are two possible options for the outcome of the execution:
Option 1: Your HANA Cloud instance is accessible and the command for starting HANA Cloud has not been triggered. You should be able to see the following execution details:
If you click on “Output Values”, you can see the output values for checkPing, isHanaCloudAvailable, and resultHanaStart:
You can verify in SAP Hana Cloud Central that your HANA Cloud instance is up and running:
Option 2: Your HANA Cloud instance is not accessible and the command for starting HANA Cloud has been triggered:
You can verify in SAP Hana Cloud Central that your HANA Cloud instance is starting:
If you click on “Output Values”, you can see the output values for checkPing, isHanaCloudAvailable, and resultHanaStart:
You have successfully performed the HANA Cloud Availability Check via SAP Automation Pilot. Now you can make a subscription in Alert Notification service, so that you can receive a notification when SAP Automation Pilot detects that your HANA Cloud instance is not accessible. If you want to do that, continue with the following steps:
16. Navigate to your Alert Notification service instance and open it. Choose the “Subscriptions” tab form the left-side menu and then “Create” to create a new subscription:
17. Enter a name for your subscription and click “Create” to move on to the next step:
18. Next, create a Condition. Give your condition a name. Then define your condition by choosing the event property “eventType”, operand “Is Equal To”, and, in our case, expected value “FailedHCAvailabilityCheck”:
The expected value for “eventType” is the one you provided in step 11:
19. To finish your subscription in Alert Notification service, select an Action by choosing “Create Action”:
Select the Action Type of your preference, for example “Email”, and choose “Next”:
Give your Action a name, and then provide the email address where you want to receive the email notification:
NOTE: After you have created some of the actions, they are labeled as Not Confirmed. To enable them, you have to confirm them as described in Confirming Actions.
20. Choose “Save” to finish making your subscription. You will see a confirmation that your subscription was created:
You can find more information about Subscriptions, Conditions, and Actions in Configuration Management Using the SAP BTP Cockpit.
21. Now you can test your subscription. If you stop your HANA Cloud Instance and trigger the CheckHanaCloudAvailabilitySample command again, you will receive an email from Alert Notification service with information that the HANA Cloud Availability Check has failed. You can see an example email below:
22. Alternative: Send notification to a Microsoft Teams channel
To send a notification to a Microsoft Teams channel of your choice, first you need to add an Incoming Webhook to this channel. To do this, follow these steps:
1) In your channel, select “Manage channel” from the “More options” menu:
2) Choose “Edit”:
3) Add the Incoming Webhook:
4) Provide a name for the incoming webhook and click “Create”:
5) You will be provided with a unique webhook URL. Copy it, as you will need to use it when creating an Action in Alert Notification service. Click “Done” and the webhook will be added to your MS Teams channel.
6) When creating an Action in Alert Notification service, choose the Microsoft Teams Action Type:
7) Give your Action a name and paste the webhook URL in the URL field. Then choose “Create”:
With this configuration, if the HАНА Cloud Availability Check fails, you will receive a notification in the MS Teams channel of your choice. Here’s an example MS Teams notification:
.. and there we have it! You’ve successfully automated the monitoring of your HANA Cloud instances!
As further reading and extra reference materials you can also consult these resources:
Credits to: @Dan_vL for the valuable content and also for his insights and pointing to it! Moreover, credits to @alisa_dermen for her contribution to this blog-post. Thank you both!
In this blog, you've learned to utilize SAP Automation Pilot and SAP Alert Notification service for SAP BTP to effectively monitor the availability of your HANA Cloud instances, and even start the ones that are not accessible. Combining these cutting-edge tools gives you unprecedented control over your operations. So, march ahead, keep disruptions at bay, and embrace a smooth and efficient journey with your HANA Cloud instances with the help of SAP Automation Pilot and SAP Alert Notification service for SAP BTP!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
17 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |