Solved

how to use wlst to check runtime thread value and then send an email

Posted on 2011-02-18
1
2,219 Views
Last Modified: 2012-06-21
Hi Folks,

I am trying to use wlst to send an email whenever the runtime thread value exceeds some certain value let say 35.
I have found some links for that and unable to get it working.
http://wlstbyexamples.blogspot.com/2009/06/self-tuned-thread-pool-count.html
http://weblogic-wonders.com/weblogic/2010/11/13/sending-e-mail-alert-on-weblogic-server-shutdown/

So, now iam trying to redirect the o/p of wlst to a text file and then grep on that file and use if else statement.
The problem is redirect command is able to write to the mentioned file but its not writing the runtime value.

Below is interactive command with wlst:
wls:/testdom/serverConfig> redirect('/tmp/test.test')  ---- (redirecting to /tmp)
wls:/testdom/serverConfig> serverRuntime()
Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.
For more help, use help(serverRuntime)

wls:/testdom/serverRuntime> cd('serverRuntime:/ThreadPoolRuntime/ThreadPoolRuntime/')
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getHoggingThreadCount()
0
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getExecuteThreadTotalCount()
8
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getExecuteThreadIdleCount()
0
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getPendingUserRequestCount()
0
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getQueueLength()
0
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> cmo.getThroughput()
0.4975124378109453
wls:/testdom/serverRuntime/ThreadPoolRuntime/ThreadPoolRuntime> disconnect()
Disconnected from weblogic server: testdom_a1
wls:/offline> stopRedirect()
WLST output will no longer be redirected to /tmp/test.test.
wls:/offline> exit()

----
But when i check my /tmp/test.test file i dont see the runtime value.

bash-3.00$ more test.test
Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.
For more help, use help(serverRuntime)

Disconnected from weblogic server: cmsintprd_a1
WLST output will no longer be redirected to /tmp/test.test.
bash-3.00$


Is there any way get the values written to a file and then use a shell script to send email?

Thank you,
Joe






0
Comment
Question by:jayatallen
1 Comment
 
LVL 3

Accepted Solution

by:
saranyannarayanan earned 250 total points
Comment Utility
do the wls:/testdom/serverConfig> redirect('/tmp/test.test')  ---- (redirecting to /tmp)
after wls:/testdom/serverConfig> serverRuntime()
or other commands and check if it works for you
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now