WebLogic Server has a nice built-in feature called the WebLogic Diagnostic Framework. In this tool you can collect your own profile by creating charts, selecting the mbeans and performance counters of your desire.
Now it can be difficult and time-consuming, every time you want to collect some performance metrics using WLDF, so there is a profilepackage available which has some pre-configured collecting profiles.
The package contains a set of Jython classes that contains Watch configurations for that profile, which can then be modified or extended to suit your individual needs.
First of all, an available profile you can download from Oracle samplecode site from Oracle. Transfer it to your WLS host, unpack it by jar -xvf wldf.jar; a META-INF and src directory will be created.
You can create modular profiles to collect data from EJB, JDBC or JMS or create a Total profile to create all. This profile contains the necessary watches and notifications and even a possibility to mail it to your email address.
Here is the way to get it to work. I created a profile against a Oracle FMW SOA Suite 11g environment.
– First, an Oracle FMW environment like SOA Suite or Forms 11g, comes with an ‘out of the box’. To target your own profile to a managed server, you will have to untarget the existing FMWD-module. Go to: Home > Summary of Diagnostic Modules > Module-FMWDFW > and untarget the module for the Server Instance you’d like to attach your own profile to.
– To enable the profile, make sure you can run WLST from commandline by running the setDomainEnv.sh from the <Domain_Home>/bin.
java weblogic.WLST enableAllProfiles.py user=’weblogic’ pass='<password>’ url=’t3://<WLSHOST:PORT>’ targets=’AdminServer,soa_test1′ wldfResource=’perfomanceProfile’ harvesterPeriod=30000.
Watch the profile being created…
When you get the message ‘ Activation completed’, go in your Admin Console, Home > Summary of Diagnostic Modules > and click on your newly created profile.
Click on the tab Collected Metrics and there you see all kinds of Metrics Nice, isn’t it?
In here, you can adjust your Metrics and watches to your own wishes. Let’s take a look at the StuckThreadWatch.
Default from this profile this watch sends a notification if Stuck Thread Count > 0.
Of course you can take a higher value by editing the Watch rule. The Alarms are set to Automatic Reset to be evaluated automatically, and if you see the Notification tab you can see a Notification is send through JMX( to any connected JMX Client (could be a monitoring system)) on SNMP or SMTP.
Create a Mail Notification
In addition, you can create a mail notification to send automatic emails if an event occurs.
The createSMTPNotification.py is being used for this. This is how it can be enabled:
– Execute :
java weblogic.WLST createSMTPNotification.py user=’weblogic’ pass='<password>’ url=’t3://<WLSHOST:PORT>’ sessionName=’MailSession’ sessionJNDIName=’mail/notificationEmail’ sessionProps=’ mail.user=michel;mail.host=mail01′ name=’smtpNotif’ recipients=’firstname.lastname@example.org’ wldfResource=’perfomanceProfile’
See how the mailsession is created…
If you look in your AdminConsole, you can see that your session is created.
Now, also look at you performance Profile Module to see if the email notification is attached:
This concludes this blog, you now can tweak and utilize you diagnostic module with loads of options.
Hebt u vragen of suggesties?
De Bruyn Kopsstraat 9
2288EC Rijswijk (ZH)
+31.(0)70 319 5000