Writing a WLST script is an art of Administration. You will be using Python code, Jython scripting for building WebLogic platforms SOA, OSB, Portals, WebCenter, FMW. WLST is a Weapon in the hands of Middleware Engineers, Most of the WLST automations makes life easy for WebLogic Administrator, Configuring, Monitoring JDBC, JMS, JVM, Threads made simple.

Search This Blog

Oracle Fusion Middleware Administration Course

Friday, June 22, 2012

Intro: We got a mail from Richard who wish to write a WLST script to monitor a JMS Runtime. The Queue performance details wish to collect.

WLST script to monitor JMS and store the attribute values when there is Production live available or Performance test run going on with multiple user load collect the statistcs and send that into a separate CSV file. Just to give little idea on CVS, A comma-separated values (CSV) file are also referred as a flat files, ascii files, and it is a spreadsheet convertible files. Richi want the logic to storing the statistics to a .csv file. Thought that it will be helpful for anyone who may have similar thoughts. We got the script idea from Richi that consisting the following prototype.

Writing to a CVS file has been simplified without using writer.csv, instead commas have been used and the file extension is hard coded as .csv, once you open the file you will see a prompt where in you need to select comma as the delimeter so that the values of jms statistics will be sorted accordingly, you can modify the script as per your need.

The script flow will be as mentioned below

Open a file with write access.

Get the RUNNING servers of the domain from domainRuntimeService.

Print the headers of JMS counters.

Get the details of JMS servers using JMSRuntime and JMSServers functions.

Using a loop get the jms server destinations.

Using a loop get the details of the parameters like ConsumersCurrentCount, ConsumersHighCount etc of the destinations and store those to variables.

Sunday, June 10, 2012

One fine morning we (WLA support Team) got an assignment, The summary of the assignment was to find "How the WebLogic server instance performing for a DataSource?". WebLogic 9.x onwards a DataSource is associated with a ConnectionPool (a pool of connections to the DB). If we monitor ConnectionPool, inturn it is nothing but monitoring a DataSource.

Of-course the task is not that easy, I have gone through various WebLogic forums to find a appropriate solution for this task.

Here I am publishing the same script which Madan Noru/Satya prepared in the old bea fourms or ObjectMix forums. Only one thing is difference is that displaying pattern, I had created a separate header, so that output looks good to see in a table form. To make this possible I have used C-Style print command from Python Language. This format you can change as per your screen display size.

The script will retrieve the JDBC Connection Pool MBean using adminHome, which is deprecated object in WLST. The output of the script will gives you the values of the following attributes:

In Year 2012 revisting the same script

We have trouble in the produciton environment with JDBC Connection pool overloaded. All the ActiveConnectionCount reaching the MaxCapacity of the Connection pool. As a temprory workaround we need to reset the Connection pool for that movement. Permanent cure is tuning the Connection pool. For both solutions we need active monitoring the JDBC Connection pool.
To monitor this we have revisited the same script. Now adding more saus to the script we need to find that ActiveConnectionCount reaching 85% as threshold limit. Once it reaches 85 or greater then monitoring tool like HP OV/some other tool will reads log file generated by the script and then sends warns message to supporting Middleware Admin when threshold crossed. If you have sendmail service on your machine you can send message fromt he script itself.
To do this we had manupulated the above script according to the requirements

We have specified DataSource that are causing this trouble

Used separate properties file for user credentials.

The output of script is redirected to a file

Managed Server name opposite to the monitor values it is tricky but resolved The new script is

Post script actions

Schedule a scheduler to run this script autosys or crontab that invokes above shell script.

Configure a monitoring tool frequently lookup the logs and send alert messages such as HP OVO or smpt mailing also fine.

What do you think about this new version of script? Write back your comments and suggestions to deliver better. Refernce Object Mix discussion:
http://objectmix.com/weblogic/549153-weblogic-monitoring-script-wlst-2.html
-->

Oracle WebLogic Administration Course

Followers

About Me

I am working as a Technical Consultant and providing solutions in WebLogic based platform architect, SOA, integration, Oracle Fusion Middleware, security and web development. Worked extensively on automation with generic WLST Scripts. Many people were impressed with my automation tasks which are developed with a foresight in re usability, troubleshooting the issues.

Worked as Java Developer till 2006. Contributed automation scripts for the book titled "Advanced WebLogic Server Automation". Started Technical blogging since 2008 for the following blogs: