File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Monitoring the state of a managed Server

 
mohamed loudiyi
Greenhorn
Posts: 1
  • 0
  • 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

stop()
trasfer(properties)
start()

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
runtime()

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


for m in mbeans :
try:
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)
except:
print "unable to stop server : ", m.getName()

def getTargetType(self ,objectName) :
# code here works
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic