Solved

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

Posted on 2011-02-18
1
2,233 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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