Alerts from your SAP Cloud Platform Solution to SAP Solution Manager via SAP Cloud Platform Alert Notification
This blog post is part of a series of blog posts related to SAP Cloud Platform Alert Notification service. You can relate to the parent blog post for more detailed information about the service itself.
For the sake of readability, we often use Alert Notification as a short form of the complete SAP Cloud Platform Alert Notification name.
We are happy to announce that now Alert Notification offers out-of-the box integration with SAP Solution Manager 7.2. This ensures broader monitoring coverage of hybrid scenarios, as SAP’s customers would be able to receive alerts from SAP Cloud Platform in their on-premise SAP Solution Manager systems. How it works? Utilizing the Alert Notification’s Consumer API, SAP Solution Manager 7.2 pulls events that are explicitly set to be stored in Alert Notification for later consumption and reports them in on-premise monitoring tools. The Alert Notification supports similar integration with Focused Run for SAP Solution Manager (FRUN), so stay tuned for further news!
In this blog post we are going to exemplify a basic scenario, in which a SAP Cloud Platform Neo subaccount will be integrated with a Solution Manager system.
Note: Integration with SAP Cloud Platform Cloud Foundry subaccounts is supported as well.
- Active subscription to SAP Cloud Platform Alert Notification
- SAP Solution Manager 7.2 SP08 or higher
- SAP Cloud Platform subaccount (Neo)
- Application deployed in SAP Cloud Platform, which will be monitored
In order to ensure secure HTTPS communication, we have to import the SAP Cloud Platform SSL certificates in the Solution Manager Trust Store, using configuration STRUST.
Note: Even if your scenario features the usage of SAP Cloud Platform Neo subaccount, the SSL certificate for SAP Cloud Platform Cloud Foundry is still needed, as Alert Notification technically runs there. To be sure you are about the export the correct certificate, as a hint I would suggest to navigate to the Alert Notification UI -> tab Security and start the Event Consumer Endpoint in a new browser. Then, export the SSL certificate from there. Thus, you can ensure its relevance. Refer to the following link for importing the SSL certificates.
Configurations in Alert Notification
1. Let’s start by creating a technical client in the Alert Notification, which is going to be used later for the SAP Solution Manager integration.
Logon to your SAP Cloud Platform subaccount. Navigate to the Alert Notification UI, tab Security. Choose “Create Technical Client“. In the new dialog, select client type “NEO_CUSTOMER_INDENTITY” and enter a meaningful description. As a next step, grant permissions to your client. In general, for this scenario “ALERT_READ” would be sufficient. Click “Create“. You will be displayed with the Client ID and Client Secret.
Note: Save the Client Secret for later usage, because it cannot be retrieved anymore. You can get more details here.
2. Create a “Store” action. What this action type does? It temporarily stores notifications in Alert Notification, so they can be pulled later by 3rd party application. You can check for more details here.
In the Alert Notification UI, navigate to tab Actions and choose the “Create” button. From the available list, select “Store” and click “Next” . Enter a name for your action and optionally description, label(s).
3. Assign the new “Store” action as outbound channel for an active subscription. In this showcase, the subscription is already created, but no action has been assigned to it. Well, let’s do it now! We are going to edit subscription “alerts-app-web-shop“.
Skip the first two steps, suggested by the Wizard, and head to “Select Actions“. From the available list select the newly-created action:
Click “Assign“. You will be displayed with an overview of the subscription’s details.
Configured in that way, the Alert Notification is going to store all incoming alerts related to application called “web-shop”, running in our SAP Cloud Platform subaccount. If you need further help regarding the Alert Notification’s terminology, please refer to the official documentation.
We are done with the adjustments in the Cloud. It’s time to configure our SAP Solution Manager system for being able to communicate with our SAP Cloud Platform subaccount.
Configurations in SAP Solution Manager 7.2
1. We have to integrate manually our cloud service within SAP Solution Manager. As a result, it should be listed in LMDB as an external service. Thereon, we can monitor exceptions that occur there. To ensure this configuration use SAP Solution Manager Configuration (transaction SOLMAN_SETUP). Navigate to Managed Systems Configuration → Cloud Services → Cloud Service Operations → Create Cloud Service. From the drop-down list select service type “SAP Cloud Platform” and click “Next“. Define the SAP Cloud Platform environment, in which you subaccount is running, and the relevant subaccount’s ID.
Moving forward, you will be prompted with a prefilled name for Extended Service ID. However, you can change it now, as later it will not be possible. The goal is to uniquely identify your cloud service. The base Alert Notification’s Consumer API URL will serve as a Root URL. Navigate to tab Security in the Alert Notification UI to obtain the correct value.
Note: Copy the link from “Event Consumer” till .com including.
Finally, you will be displayed with an overview of your new cloud service configurations. If no changes are needed, click “Finish“. Now, your service should be visible in Managed Systems Configurations -> Cloud Services.
2. Let’s create an HTTP endpoint for the new cloud service. It will ensure data collection through a direct connection between the SAP Solution Manager system and the respective cloud service. For this purpose, navigate to Managed Systems Configuration → Cloud Services. From the list below, locate the new cloud service and click “Configure Cloud Service“. From section Cloud Service Endpoints select “Add“. You will be displayed with a form. Below there are some tips about how you can get the required details:
- API Type: from the drop-down list select “Alert Notification Service“
- Root URL: if it is not prefilled, enter the base Alert Notification’s Consumer API URL, as described in step 1 above. In our case, this is https://clm-sl-ans-live-ans-service-api.cfapps.eu10.hana.ondemand.com
- Description: enter a meaningful description for the purpose of the HTTP endpoint
- OAuth URL: you can find it in the Alert Notification UI, section Security. Simply copy and paste the link provided for OAuth Token
- User: enter the Client ID of the OAuth client you have created in Alert Notification
- Password: use the Client Secret provided for your OAuth client
- Enter proxy settings if applicable and save the configurations.
Once you are ready, save the changes and optionally you might want to check the connection. It should be rated with a green status.
3. It’s time to configure and activate the exception monitoring. All exceptions, in the context of our scenario alerts, are collected via Exception Management and stored in a central exception store. To access the Exception Management setup you can use transaction SOLMAN_SETUP → Application Operations (left-hand side) → Exception Management. Go to step “Define scope” and from the section below select “Cloud Services“.
Note: If your cloud service is not among the listed, switch to View type “All Cloud Services“.
Select your cloud service and click “Next” twice, in order to go to step “Exception Configuration“. Go into edit mode and click on “Add/Configure Log Store“. From the available log stores, choose “SAP Cloud Platform Alert Notifications” and the endpoint that you are going to use. Click “Create“. Then you will be displayed with a list of available fields for filtering. They will help you to filter your log store further. (Optionally) Select the desired fields based on your preferences and confirm. Then, maintain the filter values for the fields in the Filter Definition panel, under the log stores table.
Note: This configuration restricts the collection of exceptions only to the ones that match the defined filter values.
In this blog post we are aiming to demonstrate a basic scenario, with focus on the required configuration steps and their purpose, that’s why we are not going to set filters for our log store. We can always do this later.
Note: Setting up no filters hides a potential risk for your productive system to be overloaded, as all alerts will be reported.
Save the changes. Navigate to step “Complete” and choose “Finish“. (Optionally) Before moving forward, we can start the Exception Management Cockpit on the SAP Fiori launchpad.
4. Configure Interface and Connection Monitoring Scenario. Use transaction SOLMAN_SETUP and navigate to Application Operations → Integration Monitoring → Interface and Connections. Let’s create a new scenario for the SAP Cloud Platform monitoring. Go to step “Define scope“, switch to edit mode and click “Create“. Wizard will guide you through the steps:
- Define a header information which will make your monitoring scenario distinguishable. Click “Next“
- Define systems which are going to be part of the scenario. In our use case, these are an SAP Solution Manager ABAP (technical) system and a Cloud (external) service. Choose to add them from the available lists and click “Continue“.
You will be forwarded directly to step “Review“. Check the summary once again, execute changes if needed and click “Save“.
Your scenario will be listed among others in Application Operations → Integration Monitoring → Interface and Connections -> step “Define Scope“. Select it and click “Next“. In “Monitoring & Alerting” jump right to sub-step “Configuration“. Now we are going to create an interface channel for the selected monitoring scenario. Change to edit mode and click “Create“.
In section General Data, define the interface type and specify the monitoring template, as it is shown on the screenshot below. (Optionally) add a description.
Click “Next“. We should define source and target for our new interface channel. In the concrete scenario, the source system is our cloud service, as the events are generated in our SAP Cloud Platform subaccount. Respectively, target is our on-premise system. Select them from the drop-down lists.
Save the changes.
Let’s maintain the new interface channel. In “Metric configurations” select the metrics you want to monitor using the checkboxes. Select Alert Notifications received from SAP CP.
Note: If the checkboxes are not editable, click the “Assigned” button, placed in section Interface channels.
You need to indicate the metric-specific parameters related to Alert Notifications received from SAP CP. Define parameters appropriate for your use case, by using “Add parameter set“.
In the example below we’ve configured the collection of exceptions (alerts) with severity ERROR, WARNING, and INFO.
Save the changes and click “Next“.
In sub-step “Activation” double click on the interface channel’s name. If you want the metrics to be displayed in the Interface and Connection Monitoring dashboard, select the Reporting checkbox. For more Information, see Displaying an Interface and Connection Monitoring Scenario. Click on the monitored metric Alert Notification received from SAP CP and pay attention to the option “Do not Group Individual Occurrences” – the checkbox should be ON. This option allows you to have an individual alert every time the data collection determines a critical event. In brief, use this flag if you do not want consecutive critical events being grouped into one alert, i.e. notified only once.
Click the button “Apply and Activate“. Then, click “Next” and in sub-step “Complete“, choose “Finish“. The new interface channel has been activated for the selected monitoring scenario. Check this link for additional details.
Having done this step, we have completed the configuration on SAP Solution Manager’s side. Let’s test the new setup and observe the alerts collected from SAP Cloud Platform in our on-premise system.
In the SAP Cloud Platform subaccount, we are going to simulate an alert which warns about a failed attempt to update application “web-shop”, running in the same subaccount. The severity is set to “ERROR”, eventType “Failed update”. Note: The alert has been generated using the SAP Alert Notification’s API for producing events. It Is not part of the Alert Notification events catalog.
Let’s start the Exception Management cockpit on SAP Fiori launchpad. Our alert should appear there under category “SAP Cloud Platform Alert Notifications“. Double click on it. The new alert might have already been listed in section “Instance Group“.
Note: By default the data extractor operates in a way that collection of data from the SAP Cloud Platform is executed on every 5 minutes. Therefore, if the alert is still missing you might have to wait a few minutes more. If you want to extend the data collection time interval, please follow the procedure described here.
If you click on “Detail” you will be displayed with the alert details.
When an alert with different rating (green) for the same metric is reported, the status in Exception Management would be changed accordingly.
Note: Flapping states in the application’s behavior, i.e. red and green consecutive alerts reported in the same extractor collection time interval, will not be displayed in Exception Management. However, Alert Notification will send both alerts to its subscribers via Slack, e-mail (whatever is configured in the subscription in addition to the Store action).
That’s it! You can get more insights from SAP Solution Manager 7.2 Expert Portal. Explore the full potential of this integration by applying it to your hybrid landscape. Enhance this scenario and adapt it to your business and development needs. The Alert Notification will take care to inform you exclusively for events you have subscribed for. Thus, you will avoid spam and overload while being aware of the state of your mission critical cloud resources, directly reported in your on-premise SAP Solution Manager system.