Weblogic send email alert configuration steps

Oracle Weblogic Server

The WebLogic Diagnostic Framework (WLDF) is a set of functionalities to monitor, collect, and analyze runtime counters, metrics, and statistical and diagnostic data from various WebLogic Server components. The metrics can be gathered from the JRockit JVM, the WebLogic domain, the WebLogic clusters, Managed Servers, applications, and every component that exposes data through MBeans. WebLogic Administrators can include active monitoring in production environments with WLDF. It is possible to configure WebLogic send email alerts when certain conditions and metrics are reached.

Steps to create the EmailAlertMailSession mail session:

1. Access the Administration Console with your web browser at http://adminhost.domain.local:7001/console.

2. Click on the Lock & Edit button to start a new edit session.

3. Click on the plus sign to open the Services tree on the left and then click on Mail Sessions.

4. Click on the New button and type EmailAlertMailSession in the Name field. Type mail/emailAlertMailSession in the JNDI Name field.

5. Add to JavaMail the properties needed according to the SMTP Server used:

mail.smtp.host=<smtp-host>

mail.smtp.port=<smtp-port>

6. Click on the Next button and select the All servers in the cluster target. Click on the Finish button.

7. Click on the Activate Changes button to finish.

Steps to create the EmailAlertModule WLDF module:

1. Access the Administration Console with your web browser at http://adminhost.domain.local:7001/console.

2. Click on the Lock & Edit button to start a new edit session.

3. Click on the plus sign to open the Diagnostics tree on the left and then click on Diagnostic Modules.

Weblogic Diagnostics Module

4. In the Summary of Diagnostic Modules page, click on the New button.

5. Type EmailAlertModule in the Name field and click on the OK button.

6. Click on the newly created EmailAlertModule WLDF module and then on the Targets tab. Select the All servers in the cluster radio button and click on the Save button.

7. Click on the Configuration tab and then the Collected Metrics tab. Change the Sampling Period value to 60000 and click on the Save Button.

8. Click on the New button in the Collected Metrics in this Module table to create a new Harvester.

Weblogic Collected Metrics Module

9. Choose ServerRuntime from the MBean Server location drop-down menu and click on the Next button.

10. Select weblogic.management.runtime.ThreadPoolRuntimeMBean from the MBean Type drop-down menu and click on the Next button.

11. Select the QueueLength item from the Collected Attributes table on the left and click on the > icon to move it to the Chosen table on the right. Click on the Next button.

Weblogic Collected Attributes Table

12. In the Select Instances page, leave the Chosen Collected Instances and Instance Expressions textboxes empty and then click on the Finish button.

Steps to create the watches and notifications for the WLDF module:

1. Click on the Watches and Notifications tab and then on the Notifications tab below. Click on the New button to create a new notification.

2. Select the SMTP (E-Mail) option in the Type drop-down menu and click on the Next button.

3. Type EmailAlertNotification in the Notification Name field and click on the Next button.

4. Select the EmailAlertMailSession option from the Mail Session Name drop-down menu. Type an e-mail address in the E-Mail Recipients textbox and click on the Finish button. This e-mail address will receive the alerts.

5. Now click on the Watches tab and click on the New button to create a new watch.

6. Type EmailAlertWatch in the Watch Name field. Leave the Collected Metrics option selected in the Watch Type field and click on the Next button.

7. Click on the Add Expressions button to add a new expression rule.

Weblogic Create Watch

8. Select the ServerRuntime option from the MBean Server location drop-down menu and then click on the Next button.

9. Select weblogic.management.runtime.ThreadPoolRuntimeMBean from the MBean Type drop-down menu and click on the Next button.

10. Select the Enter a custom Instance radio button and type com.bea:Name=ThreadPoolRuntime,ServerRuntime=my_Server*Type=ThreadPoolRuntime in the Custom Instance field. Click on the Next button.

11. Select the QueueLength option from the Message Attribute drop-down menu and select the > option from the Operator drop-down menu and type 100 in the Value field. Click on the Finish button.

Weblogic Manage Attribute Table

12. On the following screen, click on the Finish button again.

13. Click on the EmailAlertWatch to assign the notification. Click the Notifications tab.

14. Select EmailAlertNotification from the Available table to the left and click on the > icon to move it to the Chosen table to the right. Click on the Save button.

15. Click on the Activate Changes button to finish.

The diagnostic module was created with a WLDF Harvester for the QueueLength attribute of the ThreadPoolRuntimeBean MBean and a sampling period of 60000. The sampling period is the interval between metric-collection cycles, in milliseconds. The data collected by the harvester is stored in a WLDF archive.

The scenario of 100 queued requests waiting to be processed can indicate a potential problem because all threads of the WebLogic Server thread pool could be busy and the requests will not be processed fast enough, causing the incoming requests to pile up. The EmailAlertWatch watch was created for such situations to observe when the QueueLength value is greater than 100. When this condition is reached, the watch triggers an event to the EmailAlertNotification notification and an e-mail is sent to the specified recipients.

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply