WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document...

18
We make JD Edwards work better for people and harder for business WEB SERVER MONITORING AND ALERTING USING WEBLOGIC

Transcript of WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document...

Page 1: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

We make JD Edwards work better for people and harder for business

WEB SERVER MONITORING AND ALERTING

USING WEBLOGIC

Page 2: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Contents

03

04

06

08

12

14

15

16

TABLE OF

Section 01

Section 02

Section 03

Section 04

Section 05

Section 06

Section 07

Section 08

OVERVIEW

CREATE JAVAMAIL SESSION

CREATE WLDF MODULE

CREATING WATCH & NOTIFICATION

ASSOCIATE THE WATCH AND THE NOTIFICATION

CONFIGURE SAMPLING PERIOD

E-MAIL DELIVERY CONTENT

APPENDIX A – TROUBLESHOOTING

Page 3: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic web server. Since the JDE mission critical application is deployed on Oracle Weblogic you can make use of the Weblogic Diagnostic Framework (WLDF) to get diagnostic data from Weblogic Server instances. This will help administrator and system operators to see more information from under the hood. This feature plays a significant role in the production environment where the application environment should alert administrators when there is a performance or service level violation. This also eliminates the need to setup custom or third-party monitoring solutions for alerting and notification.

Choosing the heap free percentage variable as well as the sampling period is key to receiving the right amount of e-mails at the right time to catch a possible memory issue or leak proactively before the users are affected. Tweaking of the heap free percent and sampling period settings for the monitoring might be necessary to get the monitoring and alerting to your satisfaction.

01Overview

Web Server Monitoring and Alerting Using Weblogic 3

Page 4: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

02Create JavaMail Session

First step is to make sure that the underlying resources for the notification are setup. In this case we are going to use SMTP notification so let us first create the Java Mail Session.

Click “Lock & Edit” to acquire a configuration lock.

Expand Services -> Mail Sessions and click “New” to create a new Java Mail Session.

STEP 1

STEP 2

4 Web Server Monitoring and Alerting Using Weblogic

Page 5: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Provide the following fields (example print screens below):

Name = A unique name for the Mail Session.

JNDI Name = A unique name to identify mail session.

JavaMail Properties = SMTP/E-mail server information.

In the JavaMail Properties box, these are the entries needed:

mail.host=mail.imap.host=mail.smtp.user=mail.smtp.host=mail.from=mail.transport.protocol=mail.store.protocol=mail.user=mail.imap.user=

Click next to target the mail session to a server. Click the checkbox beside each instance the mail session is targeted for, then click finish.

STEPSTEP 3 4

STEP 5

Activate the changes by clicking the “Activate Changes” button.

Web Server Monitoring and Alerting Using Weblogic 5

Page 6: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

03Create WLDF Module

Next step in configuring watch and notification is to create a diagnostic module and target it to the server. You can use console or WLSTto create a diagnostic module. The following steps illustrate the steps to create a WLDF system module

Click “Lock & Edit” to acquire a configuration lock.

Click Diagnostics -> Diagnostic Modules and click “New” to create a new diagnostics module.

STEP 1

STEP 2

6 Web Server Monitoring and Alerting Using Weblogic

Page 7: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Select the newly created module and select targets tab. Select the appropriate server for target as before. Then click the “Save” button and then the “Activate Changes” button.

Provide a name and description and click OK.STEP 3

Web Server Monitoring and Alerting Using Weblogic 7

Page 8: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

04Creating Watch & Notification

Create a Watch

Each WebLogic Server instance can be configured with only one diagnostic module but you can target the same diagnostic module to multiple servers or clusters. Once the WLDF system module is created and targeted to the appropriate server then watches and notifications can be configured. The following steps illustrate how to create a Watch and a Notification.

Click “Lock & Edit” to acquire a configuration lock.

Navigate to the diagnostic module created above (i.e.Module-0) and select the “Watches and Notifications” tab and “Watches” sub-tab (if not already selected).

STEP 1

STEP 2

8 Web Server Monitoring and Alerting Using Weblogic

Page 9: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Click “New” to create a new Watch. Provide the name and select the type as “Collected Metrics”. Fill in fields similar to below, and then click Next.

Name = Heap_WatchWatch Type = “Collected Metrics”Enable Watch = Make sure it is checked

Ensure that “ServerRuntime” is selected and click Next.

If you are running WebLogic Server on Java HotSpot VM, make sure “Select an MBean Type from the following list” is selected and select “weblogic.management.runtime.JVMRuntimeMBean” and click “Next”. If you are using JRockit VM, make sure “Select an MBean Type from the following list” is selected and select “weblogic.management.runtime. JRockitRuntimeMBean” and click “Next”.

Click “Add Expressions”.

STEP 3 STEP 5

STEP 6

STEP 4

Web Server Monitoring and Alerting Using Weblogic 9

Page 10: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Select the instance for the appropriate server from the list for “Instance” and click “Next”.

For Message Attribute select “HeapFreePercent”. Note: There are also other Message Attributes (metrics) which can be monitored for in other cases.

For the Operator Attribute select “<”.

For the Value attribute type the percentage value you require (i.e. “10”).

Click “Finish” twice to create a Watch.

Activate the changes.

The above watch will trigger the configured notification if the percentage of free heap is less than 10. Now we will create the

notification and will associate it to the watch in the following steps.

STEP 7

STEP 8STEP 9

10 Web Server Monitoring and Alerting Using Weblogic

Page 11: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Select “SMTP (E-Mail)” for Type and click “Next”.

Provide a name - DV_Email_Notification. Make sure the notification is enabled and click “Next”.

7. Click “Finish”, and then Activate the changes.

Configure the following properties for the “Config Notification - SMTP Properties” page.

Mail Session Name

E-Mail Recipients

STEP 2

STEP 3 STEP 5

STEP 4Create a Notification

Click “Lock & Edit” to acquire a configuration lock.

Navigate to the diagnostic module created above and select the “Watches and Notifications” tab and “Notification” sub-tab.

Click “New” to create a new Notification.

STEP 1

Web Server Monitoring and Alerting Using Weblogic 11

Page 12: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

05Associate the Watch and the Notification

Click “Lock & Edit” to acquire a configuration lock.

Navigate to the diagnostic module created above (i.e. Module-0) and select the “Watches and Notifications” tab and “Watches” sub-tab (if not already selected).

Select the watch you created earlier – i.e. Heap_Watch.

Select the “Notifications” tab and move the “DV_Email_Notification” from Available to Chosen. Click on “Save”.

STEP 1

STEP 2

12 Web Server Monitoring and Alerting Using Weblogic

Page 13: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

Select the “Alarms” tab and select “Use an automatic reset alarm”. Set the “Automatic reset period” to 60 and click “Save”. This will ensure that the notifications are at least 90 seconds apart.

Click “Activate Changes”.

STEP 3

STEP 4

Web Server Monitoring and Alerting Using Weblogic 13

Page 14: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

06Configure Sampling Period Click “Lock & Edit” to acquire a configuration lock.

Navigate to the diagnostic module created above (i.e. Module-0) and select the “Collected Metrics” tab.

Ensure that “Enabled’ check-box is selected.

Choose a “Sampling Period”. The default is 300000 milliseconds, which means it will collect samples once every 5 minutes. As

an example you can change the “Sampling Period” to 120000 so that it will collect samples once every two minute.

Click “Activate Changes”.

STEP 1

STEP 2

STEP 3

14 Web Server Monitoring and Alerting Using Weblogic

Page 15: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

The default e-mail delivered will look similar to below.

If you want the e-mail to have a different/more intuitive subject and body, this can be done by editing the Mail Notification.

a. The path to e-mail notification is

b. Click on the “Diagnostic Modules” link in the left pane.

c. Click on the module name created.

d. Click on the “Watches and Notifications” tab on the upper screen.

e. Click on the Notifications tab on the lower screen.

f. Click on the notification name created.

g. Click on the “SMTP Properties” tab.

See areas to edit below.

07E-Mail Delivery Content

Web Server Monitoring and Alerting Using Weblogic 15

Page 16: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

If this happens, then there are two things to try and resolve.

1. Reboot the Weblogic server. Then try to Activate Changes again.If step 1 above does not work then do step 2 below.

2. Clear Weblogic Server cache manually.a. End the Weblogic Server Instance which the

monitoring is being setup on.

b. Clear the Weblogic Server cache (see below).

WebLogic Server 10.x and higher stores cached data in the instance’s “tmp” folder. To remove stale data from the cache and allow for WLS to force a refresh to obtain new data for requests made by clients, it is a simple procedure of deleting a server instance’s tmp directory contents which contain stage and cache directories and contents.

In WebLogic 9.x and lower, cached data resides in a directory path which will vary per deployment. As such, be sure to find and navigate to an equivalent path as the following example describes.

The following provides a generic example path to the tmp directory in question:

WINDOWS: cd C:\wls\user_projects\domains\<domain_name>\servers\<server_name>

UNIX: cd /wls/user_projects/domains/<domain_name>/servers/<server_name>

The following would be used to clear the cache:

WINDOWS: rd C:\wls\user_projects\domains\<domain_name>\servers\<server_name>\tmp

rd C:\wls\user_projects\domains\<domain_name>\servers\<server_name>\cache

UNIX: rm -rf /wls/user_projects/domains/<domain_name>/servers/<server_name>/tmp

rm -rf /wls/user_projects/domains/<domain_name>/servers/<server_name>/cache

c. Start the Weblogic Server Instance which the monitoring is being setup on.

08APPENDIX A – Troubleshooting

There is a chance the Weblogic server errors out when clicking on the “Activate Changes” button. The error you might experience is seen below

PROBLEM – ACTIVATING CHANGES:

RESOLUTION – ACTIVATING CHANGES

16 Web Server Monitoring and Alerting Using Weblogic

Page 17: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

This is most likely a result of how the Exchange server is setup to not relay. You will have to work with the Exchange team to allow authenticated users to relay so external e-mail addresses can be sent the e-mail alert from the Weblogic server.

The e-mail is not being delivered to external e-mail addresses. For example the e-mail goes to the client’s internal e-mail

PROBLEM – E-MAIL NOT DELIVERED TO EXTERNAL ACCOUNTS:

RESOLUTION – E-MAIL NOT DELIVERED TO EXTERNAL ACCOUNTS

Web Server Monitoring and Alerting Using Weblogic 17

Page 18: WEB SERVER MONITORING AND ALERTING USING WEBLOGIC · 2018-04-20 · The purpose of this document and setup is to configure monitoring and alerting for the JVM’s on the Weblogic

We make JD Edwards work better for people and harder for business.

PREPARED BY:

MARCUS JARRETT, Senior CNC Analyst

marcus.jarrett@erp -one.com