|
| [WLST] troubles running example from wls 10 doc |
 |
Fri, 16 May 2008 04:51:54 -070 |
Hi all,
starting from http://e-docs.bea.com/wls/docs100/config_scripting/monitoring.html
I put together the below WLST script:
def monitorServerState():
waitTime=5000
THRESHOLD=100000000
serverNames = getRunningServerNames()
domainRuntime()
for name in serverNames:
print '#### Now checking ' + name.getName()
try:
cd("/ServerRuntimes/" + name.getName() +
"/JVMRuntime/" + name.getName())
except WLSTException,e:
# this typically means the server is not active, just ignore
pass
heapSize = cmo.getHeapSizeCurrent()
if heapSize > THRESHOLD:
# do whatever is neccessary, send alerts, send email etc
print '#### WARNING: The HEAPSIZE is Greater than the Threshold'
else:
print heapSize
java.lang.Thread.sleep(waitTime)
slBean = getSLCRT(name)
status = slBean.getState()
print '#### Status of Managed Server is '+ status
where
def getRunningServerNames():
domainConfig()
return cmo.getServers()
def getSLCRT(svrName):
domainRuntime()
slrBean = cmo.lookupServerLifecycleRuntime(svrName)
return slcBean
But when I run it I got the following error:
[java] Unexpected error: exceptions.AttributeError
[java]
[java] Problem invoking WLST - Traceback (innermost last):
[java] File
"/products/software/terraferma/release3/EventBus/scripts/admin.py",
line 706, in ?
[java] File
"/products/software/terraferma/release3/EventBus/scripts/admin.py",
line 160, in admin
[java] File
"/products/software/terraferma/release3/EventBus/scripts/admin.py",
line 455, in monitorServerState
[java] File
"/products/software/terraferma/release3/EventBus/scripts/admin.py",
line 473, in getSLCRT
[java] AttributeError: lookupServerLifecycleRuntime
Where line 473 in getSLCRT is:
slrBean = cmo.lookupServerLifecycleRuntime(svrName)
Could anyone help me to understand why ?
Regards
|
| Post Reply
|
|
|
|
|
|
|
|
|
|