?
Solved

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

Posted on 2011-02-18
1
Medium Priority
?
2,294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
saranyannarayanan earned 1000 total points
ID: 35023863
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
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 …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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