Tag: WLDF

Session Monitoring Using WLDF

Hi,

Jay SenSharma

Jay SenSharma

Here is a very interesting thing we are going to see…Monitoring the Payload of HttpSession created by the Application On the Server…This is very helpful to check whether the HttpSession Attributes are Serializable or not…Because In AdminConsole you can see the Payload (Size of HttpSession) If it is NEGATIVE value means your HttpSession contains some Non Serializable contents…Hence your Application is not good enough to be deployed on a Clustered Environment..

Step1). First Of all Login to Admin Console and then Create a Diagnostic Module…
AdminConsole—Diagnostics—>Diagnostics Modules

Create a Diagnostic Module
Example:
Name: Module-0”     Save (LocK & Edit)

AdminConsole—Diagnostics—>Diagnostics Modules—>Module-0

Enabled: True (Check the CheckBox)
Targets: AdminServer (U can choose your own Target Server)
you can see the following entry in your “config.xml
C:bea103user_projectsdomains7001_Domainconfigconfig.xml sinppet

<wldf-system-resource>
<name>Module-0</name>
<target>AdminServer</target>
<descriptor-file-name>diagnostics/Module-0-3905.xml</descriptor-file-name>
<description></description>
</wldf-system-resource>

C:bea103user_projectsdomains7001_DomainconfigdiagnosticsModule-0-3905.xml

<?xml version='1.0' encoding='UTF-8'?>
<wldf-resource xmlns="http://www.bea.com/ns/weblogic/weblogic-diagnostics" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-diagnostics http://www.bea.com/ns/weblogic/weblogic-diagnostics/1.1/weblogic-diagnostics.xsd">

<name>Module-0</name>
<instrumentation>
<enabled>true</enabled>
</instrumentation>
</wldf-resource>

Step2). Now develop an EAR application and place the “weblogic-diagnostics.xml” file in the META-INF directory of EAR And “MyDiagnosticTestEAR/META-INF/weblogic-diagnostics.xml”

<?xml version="1.0" encoding="UTF-8"?>
<wldf-resource xmlns="http://www.bea.com/ns/weblogic/90/diagnostics">
<instrumentation>
<enabled>true</enabled>
<wldf-instrumentation-monitor>
<name>HttpSessionDebug</name>
<enabled>true</enabled>
</wldf-instrumentation-monitor>
</instrumentation>
</wldf-resource>

NOTE: After Creating the Diagnostic Module in AdminConsole Please restart The Server where it is targeted…

Step3). Inside the EAR Place any WEB Application where you set some data inside the HttpSession …Like:

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<html>
<body>
<%
session.setAttribute("AAAAAAAAA","BBBBBBBBBBBBBB");
session.setAttribute("CCCCCCCCC","DDDDDDDDDDDDDDDDDDDDDDDD");
%>
<BR>Data is set inside the Session:<BR>
<h4>session.setAttribute("AAAAAAAAA","BBBBBBBBBBBBBB");
<h4>session.setAttribute("CCCCCCCCC","DDDDDDDDDDDDDDDDDDDDDDDD");
</body>
</html>
Step 4). Deploy the Application and Hit your JSP …Now Login  to AdminConsole then
AdminConsole–>Diagnostics–>Log Files –>EventsDataArchive

.
.

Thanks
Jay SenSharma

E-Mail Notification Using WLDF

Hi,

Jay SenSharma

Jay SenSharma

Here is a Simple way to use WLDF (WebLogic Diagnostic Framework) to get E-Mail Notification…If the FreeHeapPercentage of the JVM goes less than 10 %.
Complete Steps can be Devided into 3-parts

A). Configuring a Mail-Session

B). Configuring WLDF Module

C). Configuring Watch And Notification

Part-A***Configuring a Mail-Session

Step1). We Need to create a Mail-Session From Admin Console:
Name: MyMailSession
MailSession JNDI Name: MyMailSessionJNDI
JavaMail Properties: (In your OutLook Options you will find the mailHost & UserName)
mail.smtp.host=myMailHost
mail.smtp.user=myMailUserName

Step2). Target your Mail Session to Any Server
AdminServer

Part-B *Configuring WLDF Module

Step1). From Admin Console Left Panel Navigate to Diagnostics–>Diagnostic Modules
Create a New DiagnosticModule
Name: MyDiagnosticModule —> Finish

Now Change the Tagret of MyDiagnosticModule to “AdminServer

Step2). now click on newly created “MyDiagnosticModule” you will find a TAB in the new Page “Collected Metrics
Create a New Collection Matrics- – – click on – – – NEXT
MBean Server location: ServerRuntime – – – NEXT
Select an MBean Type from the following list
MBean Type: weblogic.management.runtime.JVMRuntimeMBean – – – NEXT
Collected Attributes: Available HeapFreePercentage (choose) – – – NEXT – – –

Collected Instances: – Use the Arrow Button to Move the “com.bea:Name=AdminServer,ServerRuntime=AdminServer,Type=JVMRuntime
– – FINISH

Now Change the Target of this (Collection Mertix) to AdminServer (Activate Changes/save)

Part-C Configuring Watch And Notification

Step1). In Admin Console (click on Lock & Edit Button) Now navigate to
Diagnostics–>Diagnostic Modules –> MyDiagnosticModule –> Watches and Notifications
Click on “Notifications” Tab to create a New Notofication click on :New” Button

Notification Name: MyNotification
Type: SMTP (E-Mail)
Enable Notification (Check the CheckBox) – – – NEXT
Mail Session Name: MyMailSession (remember we have Created this mail Session earlier in Part-A)
E-Mail Recipients: : i.am.recipient@company.com (Enter recipient’s Valid E-Mail Id Here)
FINISH Click on (Activate Changes/save Button)

Step2). In Admin Console (click on Lock & Edit Button) and navigate to
Diagnostics–>Diagnostic Modules –> MyDiagnosticModule –> Watches and Notifications
Click on “Watches” Tab to create a New Notofication click on :New” Button
Watch Name: MyWatch
Watch Type: Collection Metrics
Enable Watch (Check) – – – NEXT
In the Next page click on “Add Expressions” Button
MBean Server location: ServerRuntime – – – NEXT
Select an MBean Type from the following list (radio Button) :
MBean Type: weblogic.management.runtime.JVMRuntimeMBean – – – NEXT
Select an Instance from the following list: com.bea:Name=AdminServer,ServerRuntime=AdminServer,Type=JVMRuntime – – – NEXT
Select an attribute from the following list:
Message Attribute: HeapFreeCurrent
Operator: =
Value: 10
– – – FINISH

(It means we should get Alerts if the FreeHeapPercentage will be 10 . U can select any other operator as well like > < <= )

You will find the Current Watch Rule: Something like this:
(${ServerRuntime//http://weblogic.management.runtime.JVMRuntimeMBeancom.bea:Name=AdminServer,ServerRuntime=AdminServer,Type=JVMRuntime//HeapFreeCurrent} = 10)

– – – NEXT (click on)
Use an automatic reset alarm (select the Radio Button) – – – NEXT
Notifications: Available MyNotification (Remember we have created this Notification) – – – FINISH
Press Activate Changes Button

.

.

———————————-

Thanks
Jay SenSharma


Copyright © 2010-2012 Middleware Magic. All rights reserved. |