+

Search Tips   |   Advanced Search

Querying cluster state

We can query cluster states and scripting.

Before starting this task, wsadmin.sh must be running. See the topic about starting the wsadmin scripting client for more information.

To query cluster state:

  1. Identify the Cluster MBean and assign it to the cluster variable.

    • Jacl:

        set cluster [$AdminControl completeObjectName cell=mycell,type=Cluster,name=cluster1,*]

    • Jython:

      cluster = AdminControl.completeObjectName('cell=mycell,type=Cluster,name=cluster1,*')
      print cluster

    This command returns the Cluster MBean.

    Example output:

      WebSphere:cell=mycell,name=cluster1,mbeanIdentifier=Cluster,type=Cluster,process=cluster1

  2. Query the cluster state.

    • Jacl:

        $AdminControl getAttribute $cluster state

    • Jython:

        AdminControl.getAttribute(cluster, 'state')

    This command returns the value of the run-time state attribute.


Related tasks

  • Use the wsadmin scripting AdminControl object for scripted administration
  • Start the wsadmin scripting client

  • Commands for the AdminControl object