You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Receive Alerts in Your On-Premise System Using Java Web Tomcat 8
12
+
<!-- description --> Configure a connection with an on-premise system to receive alert notifications locally. For example, extend your on-premise application in the corporate network to show alerts for critical or warning metrics of an SAP BTP application in the Neo environment or to take self-healing actions. Furthermore, use the Alerting Channels REST API to configure the channel for receiving such alert notifications.
13
+
12
14
<!-- loio152a1abd1a1f4618baaa6e43f55e37df -->
13
15
14
16
## Prerequisites
@@ -22,72 +24,64 @@ time: 50
22
24
- You have downloaded and initially configured the Cloud Connector.
23
25
For this tutorial, you can use the portable version. For more information, see [Cloud Connector](https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/e6c7616abb5710148cfcf3e75d96d596.html).
24
26
25
-
## Details
26
-
### You will learn
27
+
## You will learn
27
28
- How to connect with an on-premise system so that your alerts will be processed locally
28
29
30
+
## Intro
29
31
This tutorial describes the configuration with a Java Web Tomcat 8 runtime. However, you can change these settings to match with your runtime environment.
30
32
31
33
To learn more about the whole scenario, read [Receiving Alerts in the Corporate On-Premise System](https://blogs.sap.com/2021/02/05/receiving-alerts-in-the-corporate-on-premise-system-2/).
32
34
33
35
---
34
36
35
-
[ACCORDION-BEGIN [Step 1: ](Download the cloud-to-onpremise project)]
37
+
### Download the cloud-to-onpremise project
38
+
36
39
37
40
Download the project as a ZIP file from [https://github.com/SAP/cloud-sample-webhooks](https://github.com/SAP/cloud-sample-webhooks) and extract the files into a local folder.
38
41
39
-
[DONE]
40
42
41
-
[ACCORDION-END]
43
+
### Go to the folder
42
44
43
-
[ACCORDION-BEGIN [Step 2: ](Go to the folder)]
44
45
45
46
Open the Command prompt and go to the project\'s local folder **`cloud-sample-webhooks-main`**.
46
47
47
-
[DONE]
48
48
49
-
[ACCORDION-END]
49
+
### Build the project with Maven to generate a WAR file
50
50
51
-
[ACCORDION-BEGIN [Step 3: ](Build the project with Maven to generate a WAR file)]
52
51
53
52
Run the command `mvn clean install` to compile, test, and package the `cloud-sample-webhooks-main` project.
54
53
55
54
You can now find your packaged `webhooks.cloud.to.onpremise-1.0.0-SNAPSHOT.war` file in the **target** folder.
56
55
57
56
In the text area below, enter the command you used to compile, test, and package the `cloud-sample-webhooks-main` project.
58
57
59
-
[VALIDATE_1]
60
58
61
-
[ACCORDION-END]
62
59
63
-
[ACCORDION-BEGIN [Step 4: ](Deploy the WAR file on the cloud)]
60
+
### Deploy the WAR file on the cloud
61
+
64
62
65
63
Deploy the file on Java Web Tomcat 8 runtime and then start the application. For more information, see [Deploying Applications](https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/e5dfbc6cbb5710149279f67fb43d4e5d.html#loioe5dfbc6cbb5710149279f67fb43d4e5d__deploying).
66
64
67
-
[DONE]
68
65
69
-
[ACCORDION-END]
66
+
### Register an OAuth client
70
67
71
-
[ACCORDION-BEGIN [Step 5: ](Register an OAuth client)]
72
68
73
69
The webhooks application is protected with OAuth. For more information, see [Register an OAuth Client](https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/7e658b3e4cea4a79b035d0f1d2798c1f.html#loio61d8095aa39547c7b30d9aeda771497f).
74
70
75
71
> You also need to select the **Client Credentials** authorization grant.
76
72
77
-
[DONE]
78
73
79
-
[ACCORDION-END]
74
+
### Create an OAuth client and obtain access token
80
75
81
-
[ACCORDION-BEGIN [Step 6: ](Create an OAuth client and obtain access token)]
82
76
83
77
You need the access token to call the Alerting Channels REST API. For more information, see [Using Platform APIs](https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/392af9d162694d6595499f1549978aa6.html).
84
78
85
79
> Select **Monitoring Service** API and make sure that the **Manage Alerting Channels** scope is included.
86
80
87
-
[VALIDATE_2]
88
-
[ACCORDION-END]
89
81
90
-
[ACCORDION-BEGIN [Step 7: ](Create POST request to get verification token)]
82
+
83
+
### Create POST request to get verification token
84
+
91
85
92
86
Create a POST request with one of the following URIs:
93
87
@@ -122,11 +116,9 @@ Furthermore, use the access token as a bearer token in the Authorization for the
122
116
123
117
For more information, see [Alerting Channels REST API](https://api.sap.com/api/HCP_Alerting).
124
118
125
-
[DONE]
126
119
127
-
[ACCORDION-END]
120
+
### Provide the token as a system property
128
121
129
-
[ACCORDION-BEGIN [Step 8: ](Provide the token as a system property)]
130
122
131
123
Select the application in the SAP BTP cockpit, choose the **Update** button, and enter the verification token as a JVM argument (`-DverificationToken=<verification_token>`).
132
124
@@ -136,17 +128,16 @@ Finally, restart the application for your change to take effect.
136
128
137
129
In the text area below, enter the text you inserted in the **JVM Arguments** field.
138
130
139
-
[VALIDATE_3]
140
-
[ACCORDION-END]
141
131
142
-
[ACCORDION-BEGIN [Step 9: ](Deploy the WAR file locally)]
132
+
133
+
### Deploy the WAR file locally
134
+
143
135
144
136
Use Java Web Tomcat 8 server and deploy the WAR file locally. See [Deploy Locally with the Console Client](https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/937c833b72bb101490cf767db0e91070.html).
145
137
146
-
[DONE]
147
-
[ACCORDION-END]
148
138
149
-
[ACCORDION-BEGIN [Step 10: ](Configure the Cloud Connector)]
139
+
### Configure the Cloud Connector
140
+
150
141
151
142
1. Start the cloud connector.
152
143
@@ -160,10 +151,10 @@ Use Java Web Tomcat 8 server and deploy the WAR file locally. See [Deploy Locall
160
151
161
152
In the text area below, enter the text you inserted in the **URL Path** field.
162
153
163
-
[VALIDATE_4]
164
-
[ACCORDION-END]
165
154
166
-
[ACCORDION-BEGIN [Step 11: ](Configure cloud destination to the on-premise system)]
155
+
156
+
### Configure cloud destination to the on-premise system
157
+
167
158
168
159
1. Log on to the SAP BTP cockpit.
169
160
@@ -189,14 +180,10 @@ In the text area below, enter the text you inserted in the **URL Path** field.
189
180
190
181
In the text area below, enter the name you used for the destination.
191
182
192
-
[VALIDATE_5]
193
183
194
-
[ACCORDION-END]
195
184
196
-
[ACCORDION-BEGIN [Step 12: ](Test that you receive alerts)]
185
+
### Test that you receive alerts
197
186
198
-
Trigger an alert by setting low threshold values (for example, Warning Threshold = 0.00001 and Critical Threshold = 0.0001 for the availability check of the application). You should receive the alert as an `alert_<timestamp>.json` file locally in the server's workspace folder (usually in the **`…/webapps/webhooks.cloud.to.onpremise-1.0.0-SNAPSHOT`** folder).
199
187
200
-
[DONE]
188
+
Trigger an alert by setting low threshold values (for example, Warning Threshold = 0.00001 and Critical Threshold = 0.0001 for the availability check of the application). You should receive the alert as an `alert_<timestamp>.json` file locally in the server's workspace folder (usually in the **`…/webapps/webhooks.cloud.to.onpremise-1.0.0-SNAPSHOT`** folder).
0 commit comments