File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Using WLST, How can I find the status of my application running managed server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Using WLST, How can I find the status of my application running managed server?" Watch "Using WLST, How can I find the status of my application running managed server?" New topic
Author

Using WLST, How can I find the status of my application running managed server?

Gajen Logandan
Greenhorn

Joined: May 14, 2009
Posts: 13
Using WLST, How can I find the status of my application running managed server?
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
What king of information do you want? Please be more specific! You can check things like Connection pool, server health, queue, thread count, etc....

What exactly do you want to check?

[]s
Gajen Logandan
Greenhorn

Joined: May 14, 2009
Posts: 13
I just want to figure out if my application is up and running or not.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,

follows a simple script for that. Your admin server for domain must be runnning. Change variable def. to match your domain configuration. Also I'm assuming you know how to run WLST scripts.




[]s
regards.
Tom Keith
Greenhorn

Joined: Mar 26, 2002
Posts: 24
Hi,

The following example will list all applications running. In this case, I have 4 applications.

Invoking WLST script
------------------------
java weblog.WLST listAppStatus.py t3://localhost:7001


listAppStatus.py
------------------

def checkWlsApplicationState(serverURL):

clusterCheck = ""

#target indicates if it a cluster or admin server.
#In this case, AdminServer is the name of my adminserver.
#WLS defeault is myServer

target = ""

try:
connect('weblogic', 'weblogic' ,url=serverURL)
except:
dumpStack()
disconnect()

cd("AppDeployments")
myapps = ls(returnMap='true')

cd("../Servers")
domainName = cmo.getName()

cd("AdminServer")
slcBean = cmo.lookupServerLifeCycleRuntime()
status = slcBean.getState()

cd("../../")
try:
cd("Clusters/" + domainName + "_cluster")
clusterCheck = 0
except:
clusterCheck = 1

if clusterCheck == 0:
print 'Domain ' + domainName + ' is Clustered'
target = domainName + '_cluster'
else:
print 'Domain ' + domainName + ' is Not Clustered'
target = 'AdminServer'

print ''
domainRuntime()

cd("AppRuntimeStateRuntime/AppRuntimeStateRuntime")

print '-------------------------------------------------------------------------------'
print 'Application Name Intended State Current State'
print '-------------------------------------------------------------------------------'

appIndex=0

for applicationName in myapps:

intendedState = cmo.getIntendedState(applicationName, target)
currentState = cmo.getCurrentState(applicationName, target)

if appIndex == 0:
print applicationName + ' ' + intendedState + ' ' + currentState
elif appIndex == 1:
print applicationName + ' ' + intendedState + ' ' + currentState
elif appIndex == 2:
print applicationName + ' ' + intendedState + ' ' + currentState
elif appIndex == 3:
print applicationName + ' ' + intendedState + ' ' + currentState

appIndex = appIndex + 1

print '-------------------------------------------------------------------------------'

disconnect()

#Argument 1 is Admin URL
#For example: t3://localhost:7001

checkWlsApplicationState(sys.argv[1])


# End of WLST


HTH,
Tom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using WLST, How can I find the status of my application running managed server?
 
Similar Threads
Trouble running a WLST snippet
How to specify “Copy this application onto every target of me” option while using WLST deploy cmd
Can't figure out why I can't undeploy an application using WLST
WebLogic Clustering
What does this error mean -- targets are unreachable?