Example: Querying cluster state using wsadmin
The following example queries the state of the cluster:
- Identify the Cluster MBean and assign it to the cluster variable.
Using Jacl:
set cluster [$AdminControl completeObjectName cell=mycell,type=Cluster,name=cluster1,*
Using Jython:
cluster = AdminControl.completeObjectName('cell=mycell,type=Cluster,name=cluster1,*') print clusterThis command returns the Cluster MBean.
Example output:
WebSphere:cell=mycell,name=cluster1,mbeanIdentifier=Cluster,type=Cluster,process=cluster1
- Query the cluster state.
Using Jacl:
$AdminControl getAttribute $cluster state
Using Jython:
AdminControl.getAttribute(cluster, 'state')This command returns the value of the run-time state attribute.