Skip to Content

Receive Alerts in Your On-Premise System Using Java Web Tomcat 8

0 %
Receive Alerts in Your On-Premise System Using Java Web Tomcat 8

Receive Alerts in Your On-Premise System Using Java Web Tomcat 8

February 8, 2021
Created by
September 17, 2018
Configure a connection with an on-premise system to receive alert notifications locally.

You will learn

  • How to connect with an on-premise system so that your alerts will be processed locally
QR code


  • You have a customer account.
    For more information, See Getting Started with a Customer Account in the Neo Environment.
  • You have active resources (applications) to receive alerts for.
  • You have installed Maven.
  • You have downloaded and set up your Eclipse IDE, SAP BTP Tools for Java, and SDK.
    For more information, see Setting Up the Development Environment.

    To build the project into a WAR file, you need Maven Integration for Eclipse WTP.

  • You have set up Java Web Tomcat 8 as a runtime environment.
    For more information, see Java Web Tomcat 8 Runtime in Set Up the Runtime Environment.
  • You have downloaded and initially configured the Cloud Connector.
    For this tutorial, you can use the portable version. For more information, see Cloud Connector.

This tutorial describes the configuration with a Java Web Tomcat 8 runtime. However, you can change these settings to match with your runtime environment.

To learn more about the whole scenario, read Receiving Alerts in the Corporate On-Premise System.

Step 1: Download the cloud-to-onpremise project

Download the project as a ZIP file from and extract the files into a local folder.

Log on to answer question
Step 2: Import the folder into Eclipse as a Maven project

Choose File > Import… > Maven > Existing Maven Projects and follow the steps from the wizard.

Log on to answer question
Step 3: Build the project with Maven to generate a WAR file

Choose Run As > Maven build…, specify clean install for the Goals field, and run the build.


You should find the generated WAR file in a target directory of your local folder.

In the text area below, enter the text you inserted in the Goals field, and then choose Validate.

Step 4: Deploy the WAR file on the cloud

Deploy the file on Java Web Tomcat 8 runtime and then start the application. For more information, see Deploying Applications.

Log on to answer question
Step 5: Register an OAuth client

The webhooks application is protected with OAuth. For more information, see Register an OAuth Client.

You also need to select the Client Credentials authorization grant.

Log on to answer question
Step 6: Create an OAuth client and obtain access token

You need the access token to call the Alerting Channels REST API. For more information, see Using Platform APIs.

Select Monitoring Service API and make sure that the Manage Alerting Channels scope is included.

Which API name did you select for the platform API OAuth client?
Step 7: Create POST request to get verification token

Use the following code in the body of the Alerting Channels REST call:

{ "type": "WEBHOOK", "application": "app_to_receive_alerts_for", "parameters": { "url": "application_URL/webhook", "authentication": { "authenticationType": "OAUTH2", "client": "registered_client_ID", "secret": "registered_client_secret", "oAuthServerUrl": "token_endpoint_URL?grant_type=client_credentials" } } }
  • Replace application_URL with the webhook application URL. You can find it in the cloud cockpit when you select the deployed webhook application.

  • Replace registered_client_ID and registered_client_secret with the client ID and secret created when registering the OAuth client for the webhook application.

  • Replace token_endpoint_URL with the URL shown for the subaccount at Security > OAuth > Branding > Token Endpoint in the cloud cockpit.

The application parameter is optional, and you do not specify it for alerts on account level. For more information, see Alerting Channels REST API.

Log on to answer question
Step 8: Provide the token as a system property

Select the application in the cloud cockpit, choose the Update button, and enter the verification token as a JVM argument (-DverificationToken=<verification_token>).


Finally, restart the application for your change to take effect.

In the text area below, enter the text you inserted in the JVM Arguments field, and then choose Validate.

Step 9: Deploy the WAR file locally

Use Java Web Tomcat 8 server and > servlet. Then, on the Web Modules page of Java Web Tomcat 8 Server, set the path /.

For more information, see Deploy Locally from Eclipse IDE.

Log on to answer question
Step 10: Configure the Cloud Connector
  1. Start the cloud connector.

  2. Configure the access control.

    Go to the Cloud to On-Premise view and add the mapping /backend.


In the text area below, enter the text you inserted in the URL Path field, and then choose Validate.

Step 11: Configure cloud destination to the on-premise system
  1. Log on to the cloud cockpit.

  2. Select the subaccount.

  3. Go to Connectivity > Destinations.

  4. Create a new destination with the following values:

    Field Name Value
    Name on-premise-destination
    Type HTTP
    URL http://<virtual host>:<virtual port>/backend
    Proxy Type OnPremise
    Authentication NoAuthentication

    For more information, see Configure the Destination in the Cloud.

    The virtual host and port are configured in the cloud connector under Cloud To On-Premise > Access Control > Mapping Virtual to Internal System.

In the text area below, enter the name you used for the destination, and then choose Validate.

Step 12: Test that you receive alerts

Trigger an alert by setting low threshold values (for example, Warning Threshold = 0.00001 and Critical Threshold = 0.0001). You should receive the alert as an alert_<timestamp>.json file locally in the server’s workspace folder.

You can set a custom location by updating the server and deploy paths in Eclipse. In that case, the file will be generated in the deploy path that is inside the server path.

Log on to answer question

Next Steps

Back to top