WebSphere Application Server - Express, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Querying server state using scripting

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

Why and when to perform this task

Perform the following steps to query the server state:

Steps for this task

  1. Identify the server and assign it to the server variable. The following example returns the server MBean that matches the partial object name string:
    • Using Jacl:
      set server [$AdminControl completeObjectName cell=mycell,node=mynode,
      name=server1,type=Server,*]
    • Using Jython:
      server = AdminControl.completObjectName('cell=mycell,node=mynode,
      name=server1,type=Server,*')
      print server
    Example output:
    WebSphere:cell=mycell,name=server1,mbeanIdentifier=server.xml#Server_1,
    type=Server,node=mynode,process=server1,processType=ManagedProcess
    
  2. Query for the state attribute. For example:
    • Using Jacl:
      $AdminControl getAttribute $server state
    • Using Jython:
      print AdminControl.getAttribute(server, 'state')
    The getAttribute command returns the value of a single attribute.
    Example output:
    STARTED



Related concepts
AdminControl object for scripted administration

Related reference
Commands for the AdminControl object

Task topic    

Terms of Use | Feedback

Last updated: Jun 8, 2005 12:45:23 PM EDT
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/txml_queryserver.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)