Query server state using scripting



Search Tips   |   Advanced Search


The following wsadmin commands use AdminControl to return a value of STARTED if the server is started, and an empty string if server is stopped.


### Identify the server and assign it to the server variable.
set server [$AdminControl completeObjectName cell=mycell,node=mynode, name=server1,type=Server,*]

### Query for the state attribute.
$AdminControl getAttribute $server state


server = AdminControl.completeObjectName('cell=mycell,node=mynode, name=server1,type=Server,*')
print server
print AdminControl.getAttribute(server, 'state')

In an ND environment, we can query server state from the admin console.


Related tasks

Use AdminControl for scripted administration



Commands for AdminControl