Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic