Example WLST Script to Obtain JDBC and JTA MBean Values
Posted
by Daniel Mortimer
on Oracle Blogs
See other posts from Oracle Blogs
or by Daniel Mortimer
Published on Tue, 25 Jun 2013 14:58:36 +0000
Indexed on
2013/06/25
16:25 UTC
Read the original article
Hit count: 975
/Oracle
Introduction
Following on from the blog entry "Get an Offline or Online WebLogic Domain Summary Using WLST!", I have had a request to create a smaller example which only collects a selection of JDBC (System Resource) and JTA configuration and runtime MBeans values. So, here it is.
Download Sample Script
You can grab the sample script by clicking here.
Instructions to Run:
1. After download, extract the zip to the machine hosting the WebLogic environment. You should have three directories along with a readme.txt
- output
- Sample_Output
- scripts
2. In the scripts directory, find the start wrapper script startWLSTJDBCSummarizer.sh (Unix) or startWLSTJDBCSummarizer.cmd (MS Windows). Open the appropriate file in an editor and change the environment variable settings to suit your system.
Example - startWLSTDomainSummarizer.cmd
set WL_HOME=D:\product\FMW11g\wlserver_10.3 set DOMAIN_HOME=D:\product\FMW11g\user_projects\domains\MyDomain set WLST_OUTPUT_PATH=D:\WLSTDomainSummarizer\output\ set WLST_OUTPUT_FILE=WLST_JDBC_Summary_Via_MBeans.html call "%WL_HOME%\common\bin\wlst.cmd" WLS_JDBC_Summary_Online.py
Note: The WLST_OUTPUT_PATH directory value must have a trailing slash. If there is no trailing slash, the script will error and not continue.
3. Run the shell / command line wrapper script. It should launch WLST and kick off "WLS_JDBC_Summary_Online.py". This will hit you with some prompts e.g.
Is your domain Admin Server up and running and do you have the connection details? (Y /N ):
Y
Enter connection URL to Admin Server e.g t3://mymachine.acme.com:7001 :
t3://localhost:7001
Enter weblogic username:
weblogic
Enter weblogic username password (function prompt 1):
welcome1
(Note: the value typed in for password will not be echoed back to the console).
4. If the scripts run successfully, you should get a HTML summary in the specified output directory. See example screenshots below:
Screenshot 1 - JDBC System Resource Tab Page
Screenshot 2 - JTA Tab Page
5. For the HTML to render correctly, ensure the .js and .css files provided (review the output directory created by the zip file extraction) are accessible. For example, to view the HTML locally (without using a web server), place the HTML output, jquery-ui.js, spry.js and wlstsummarizer.css in the same directory.
Disclaimer
This is a sample script. I have tested it against WebLogic Server 10.3.6 domains on MS Windows and Unix. I cannot guarantee that the script will run error free or produce the expected output on your system. If you have any feedback add a comment to the blog. I will endeavour to fix any problems with my WLST code.
Credits
JQuery: http://jquery.com/
Spry (Adobe) : https://github.com/adobe/Spry
http://www.red-team-design.com/cool-headings-with-pseudo-elements
© Oracle Blogs or respective owner