How to start all the appservers using wsadmin jython script?

225 Views Asked by At

I am trying to start all the appservers managed by a DMGR using Jython, I have come up with this script but it is not working. Can anyone guide me what could be wrong here.

server = AdminConfig.list( 'Server' );
mbean  = AdminConfig.getObjectName( server );
AdminControl.invoke( mbean, 'restart' );

# combined into a single statement, this would be:

AdminControl.invoke( AdminConfig.getObjectName( AdminConfig.list( 'Server' ) ), 'restart' );
1

There are 1 best solutions below

2
Bruce T. On

There's a library of jython functions that probably handles it here https://github.com/wsadminlib/wsadminlib. Look for startAllServersInCluster