permaculture playing cards
The moose likes BEA/Weblogic and the fly likes Monitoring the state of a managed Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Monitoring the state of a managed Server" Watch "Monitoring the state of a managed Server" New topic

Monitoring the state of a managed Server

mohamed loudiyi

Joined: Feb 28, 2009
Posts: 1
Hi all.

I am new with wlst and I hope someone can help me.
Ik have to stop a cluster or a managed server (target), then I have to copy a file to this target and then I have to restart it.
Before I can restart my target, I want to be sure that my target have the state SHUTDOWN.
The only problem is that home.getMBeansByType("ServerRuntime") return only the servers wich have the state Running and not the state shutdown

I am executing these methods


before I can execute the start() method, I have to be sure that my managed Server or cluster is really shutdown
and I can not use this statement state = state(target, entityType), because state does not return a value.

I am writing my script in python and I am using weblogic 8.

def doStop(self, targets) :
ignoreSessions = "false"
timeOut = 60

mbeans = home.getMBeansByType("ServerRuntime")
print "mbeans", mbeans

for m in mbeans :
for t in targets:
target = t1:len(t)-1
print "target", target
if (m.getName() == target):
if(m.getAttribute("State") == "RUNNING"):

# entityType can be a server or a cluser.
entityType = self.getTargetType(target)

print "en"
shutdown(target, "Server", ignoreSessions, timeOut, "false")
state(target, entityType)
print "unable to stop server : ", m.getName()

def getTargetType(self ,objectName) :
# code here works
I agree. Here's the link:
subject: Monitoring the state of a managed Server
It's not a secret anymore!