I have a Websphere cell with 6 nodes(1 dmgr+5 nodeagents) and 30 jvms(5 jvms on each node). I want to kill all the 30 jvms by login into dmgr node server using wsadmin.sh from /opt/WebSphere/AppServer855/profiles/dmgrprofile/bin/. Could I have a jython script to achieve this? Please help me. Note: I do not want to kill nodeagents or dmgr. Thanks, Kumar.
Asked
Active
Viewed 937 times
1 Answers
2
Use AdminTask.listServers command to get the list of all application servers in a cell, or on a specific node, and then iterate the list and stop server by using AdminControl.stopServer command.
all_servers=AdminTask.listServers('[-serverType APPLICATION_SERVER ]').splitlines()
for server in all_servers:
serverName=AdminConfig.showAttribute(server, 'name')
#stop server if its running
try:
AdminControl.stopServer(serverName,'immediate')
except:
print (serverName +" is not reachable")

M I P
- 867
- 10
- 25