Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Monitoring the state of a managed Server  RSS feed

mohamed loudiyi
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!