Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Cluster servers with wsadmin scripting


Query cluster state using scripting

We can query cluster states using wsadmin and scripting.

Perform the following steps to query cluster state:


Procedure

  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.


Use the wsadmin scripting AdminControl object for scripted administration
Start the wsadmin scripting client using wsadmin.sh


Related


Commands for the AdminControl object using wsadmin.sh

+

Search Tips   |   Advanced Search