• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using WLST, How can I find the status of my application running managed server?
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just want to figure out if my application is up and running or not.
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic