+

Search Tips   |   Advanced Search

Commands for AdminControl


Use AdminControl to invoke operational commands that manage objects for the appserver.

Many of the AdminControl commands have multiple signatures so that they can either invoke in a raw mode using parameters specified by Java Management Extensions (JMX), or by using strings for parameters. In addition to operational commands, AdminControl supports some utility commands for tracing, reconnecting with a server, and converting data types.

The following commands are available for AdminControl:

 

completeObjectName

Create a string representation of a complete ObjectName value that is based on a fragment. This command does not communicate with the server to find a matching ObjectName value. If the system finds several MBeans that match the fragment, the command returns the first one.

Required parameters:

object name

Name of the object to complete. (ObjectName)

template

Name of the template to use. For example, the template might be type=Server,*. (java.lang.String)

Optional parameters: None.

Sample output:

The command does not return output.

Examples...

 

getAttribute

Return the value of the attribute for the name that you provide.

Required parameters:

object name

Object name of the MBean of interest. (ObjectName)

attribute

Name of the attribute to query. (java.lang.String)

Optional parameters: None.

Sample output:

String that contains the value of the attribute that you query...

'DeploymentManager'

Examples...

 

getAttribute_jmx

Return the value of the attribute for the name that you provide.

Required parameters:

object name

Object name of the MBean of interest. (ObjectName)

attribute

Name of the attribute to query. (java.lang.String)

Optional parameters: None.

Sample output:

String that contains the value of the attribute that you query

'DeploymentManager'

Examples...

 

getAttributes

Return the attribute values for the names that you provide.

Required parameters:

object name

Object name of the MBean of interest. (ObjectName)

attribute

Names of the attributes to query. (java.lang.String[] or java.lang.Object[])

Optional parameters: None.

Sample output:

String that contains the value of the attribute that you query...

'[ [cellName MyCell] [nodeName MyNode] ]'

Examples...

 

getAttributes_jmx

Return the attribute values for the names that you provide.

Required parameters:

object name

Object name of the MBean of interest. (ObjectName)

attribute

Names of the attributes to query. (java.lang.String[] or java.lang.Object[])

Optional parameters: None.

Sample output:

Attribute list.

Examples...

 

getCell

Return the name of the connected cell.

Target object

None.

Required parameters:None.

Optional parameters: None.

Sample output: Returns the cell name that you query

Mycell

Examples...

 

getConfigId

Create a configuration ID from an ObjectName or an ObjectName fragment. Each MBean does not have corresponding configuration objects. If several MBeans correspond to an ObjectName fragment, a warning is created and a configuration ID builds for the first MBean that the system finds.

Required parameters:

object name

Name of the object of interest. The object name string can be a wildcard, specified with an asterisk character (*).

Optional parameters: None.

Sample output:

String that contains the configuration ID of interest.

Examples...

 

getDefaultDomain

Return the default domain name from the server.

Required parameters:None.

Optional parameters: None.

Sample output: String that contains the default domain name of interest

WebSphere

Examples...

 

getDomainName

Return the domain name from the server.

Required parameters:None.

Optional parameters: None.

Sample output:

String that contains the domain name of interest

WebSphere

Examples...

 

getHost

Return the name of the host.

Target object

None.

Required parameters:None.

Optional parameters: None.

Sample output:

String that contains the name of the host of interest

myHost

Examples...

 

getMBeanCount

Return the number of MBeans that are registered in the server.

Required parameters:None.

Optional parameters: None.

Sample output:

Integer value that contains the number of MBeans that are registered in the server

151

Examples...

 

getMBeanInfo_jmx

Return the Java Management Extension MBeanInfo structure that corresponds to an ObjectName value. No string signature exists for this command, because the Help object displays most of the information available from the getMBeanInfo_jmx command.

Target object

None.

Required parameters:

object name

Object name of the MBean of interest. (ObjectName)

Optional parameters: None.

Sample output: javax.management.MBeanInfo object

javax.management.modelmbean.ModelMBeanInfoSupport@10dd5f35

Examples...

 

getNode

Return the name of the connected node.

Target object

None.

Required parameters:None.

Optional parameters: None.

Sample output:

String containing the name of the node

myNode01

Examples...

 

getObjectInstance

Return the object instance that matches the input object name.

Required parameters:

object name

Name of the object of interest. (ObjectName)

Optional parameters: None.

Sample output: Returns the object instance that matches the input object name

javax.management.modelmbean.RequiredModelMBean

Examples...

 

getPort

Return the name of the port used for the scripting connection.

Required parameters:None.

Optional parameters: None.

Sample output: Returns the port number of the port that the system uses to establish the scripting connection

8877

Examples...

 

getPropertiesForDataSource (Deprecated)

The getPropertiesForDataSource command is deprecated, and no replacement exists. This command incorrectly assumes the availability of a configuration service when running in connected mode.

Required parameters:None.

Optional parameters: None.

Sample output: Returns the following message:

WASX7389E: Operation not supported - getPropertiesForDataSource command is not supported.

Examples...

 

getType

Return the connection type used for the scripting connection.

Required parameters:None.

Optional parameters: None.

Sample output: String that contains the connection type for the scripting connection...

SOAP

Examples...

 

help

Return general help text for AdminControl.

Required parameters:None.

Optional parameters:

command

Command for which to return help information. The command name is not case-sensitive.

If we specify a specific command with the help command, wsadmin returns detailed help about the command


WASX7043I: command: getAttribute
Arguments: object name, attribute
Description: Returns value of "attribute" for the MBean described by "object name."

Examples...

 

invoke

Invoke an object operation with or without parameters. The command invokes the object operation using the parameter list that you supply. The signature generates automatically. The types of parameters are supplied by examining the MBeanInfo that the MBean supplies. Returns the string result of the invocation. The string that is returned is controlled by the Mbean method that you invoked. If the MBean method is synchronous, then control is returned back to wsadmin only when the operation is complete. If the Mbean method is asynchronous, control is returned back to wsadmin immediately even though the invoked task might not be complete.

Target object

None.

Required parameters:

object name

Object name of the MBean of interest.

operation

Operation to invoke.

Optional parameters:

arguments

Arguments required for the operation. If no arguments are required for the operation of interest, we can omit the arguments parameter.

Sample output:

The command returns a string that shows the result of the invocation.

Examples...



set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*]
$AdminControl invoke $objNameString appendTraceString com.ibm.*=all=enabled java.lang.String
set objNameString [$AdminControl completeObjectName WebSphere:type=DynaCache,*]
$AdminControl invoke $mbean getCacheStatistics {"DiskCacheSizeInMB ObjectsReadFromDisk4000K RemoteObjectMisses"}
  • Jython...
    objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*')
    print AdminControl.invoke(objNameString, 'stop')


    objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*')
    print AdminControl.invoke(objNameString, 'appendTraceString', 'com.ibm.*=all=enabled')

    objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*')
    print AdminControl.invoke(objNameString, 'appendTraceString', 'com.ibm.*=all=enabled', 'java.lang.String')

    objNameString = AdminControl.completeObjectName("WebSpheretype=DynaCache,*")
    AdminControl.invoke(dc, "getCacheStatistics", '["DiskCacheSizeInMB ObjectReadFromDisk4000K RemoteObjectMisses"]')

  • Use Jython list:
    objNameString = AdminControl.completeObjectName("WebSphere:type=DynaCache,*")
    AdminControl.invoke(dc, "getCacheStatistics", [["DiskCacheSizeInMB", "ObjectReadFromDisk4000K", "RemoteObjectMisses"]])

     

    invoke_jmx

    Invoke the object operation by conforming the parameter list to the signature. The command returns the result of the invocation.

    Required parameters:

    object name

    Object name of the MBean of interest. (ObjectName)

    operation

    Operation to invoke. (java.lang.String)

    Optional parameters:

    arguments

    Arguments required for the operation. If no arguments are required for the operation of interest, we can omit the arguments parameter. (java.lang.String[] or java.lang.Object[])

    Sample output:

    The command returns a string that shows the result of the invocation.

    Examples...

     

    isRegistered

    Determine if a specific object name is registered.

    Required parameters:

    object name

    Object name of interest. (java.lang.String)

    Optional parameters:None.

    Sample output: Boolean value for the object of interest. If the ObjectName value is registered in the server, then the value is 1...

    wsadmin>s = AdminControl.queryNames( 'type=Server,*' ).splitlines()[ 0 ]
    wsadmin>AdminControl.isRegistered( s )
    1
    wsadmin>

    If the ObjectName value is not registered in the server, then the value is 0.

    Examples...

     

    isRegistered_jmx

    Determine if a specific object name is registered.

    Required parameters:

    object name

    Object name of interest. (java.lang.String)

    Optional parameters:None.

    Sample output:

    Boolean value for the object of interest. If the ObjectName value is registered in the server, then the value is true...

    true

    Examples...

     

    makeObjectName

    Create an ObjectName value that is based on the strings input. This command does not communicate with the server, so the ObjectName value that results might not exist. If the string you supply contains an extra set of double quotes, they are removed. If the string does not begin with a Java Management Extensions (JMX) domain, or a string followed by a colon, then the WAS string appends to the name.

    Required parameters:

    object name

    Object name of interest. (java.lang.String)

    Optional parameters:None.

    Sample output:

    Objectname object constructed from the object name string.

    Examples...

     

    queryMBeans

    Query for a list of object instances that match the object name that you provide.

    Required parameters:

    object name

    Object name of interest. (ObjectName)

    Optional parameters:

    query

    Query expression. (QueryExp)

    Sample output: The command returns a list of object instances for the object name specified...

    WebSphere:name=PlantsByWebSphere, process=server1, platform=dynamicproxy, node=Goodog, J2EEName=PlantsByWebSphere, Server=server1, version=6.1.0.0, type=Application, mbeanIdentifier=cells/GooddogNode02Cell/applications/PlantsByWebSphere.ear/ deployments/PlantsByWebSphere/deployment.xml#ApplicationDeployment_1126623343902, cell=GooddogNode02Cell

    Examples...

     

    queryNames

    Query for a list of each of the ObjectName objects based on the name template.

    Required parameters:

    object name

    Object name of interest. We can specify a wildcard for the object name parameter with the asterisk character (*). (java.lang.String)

    Optional parameters:None.

    Sample output:

    String that contains the ObjectNames that match the input object name...

    WebSphere:cell=BaseApplicationServerCell, name=server1,mbeanIdentifier=server1, type=Server,node=mynode,process=server1

    Examples...

     

    queryNames_jmx

    Query for a list of each of the ObjectName objects based on the name template and the query conditions specified.

    Required parameters:

    object name

    Object name of interest. We can specify a wildcard for the object name parameter with the asterisk character (*). (ObjectName)

    query

    Query expression to use. (javax.management.QueryExp)

    Optional parameters:None.

    Sample output:

    String that contains the ObjectNames that match the input object name...

    [WebSphere:cell=BaseApplicationServerCell, name=server1, mbeanIdentifier=server1, type=Server, node=mynode, process=server1]

    Examples...

     

    reconnect

    Reconnect to the server, and to clear information out of the local cache.

    Required parameters:None.

    Optional parameters:None.

    Sample output: Message that displays the status of the operation

    WASX7074I: Reconnect of SOAP connector to host myhost completed.

    Examples...

     

    setAttribute

    Set the attribute value for the name that you provide.

    Required parameters:

    object name

    Object name of the MBean of interest. (java.lang.String)

    attribute name

    Name of the attribute to set. (java.lang.String)

    attribute value

    Value of the attribute of interest. (java.lang.String)

    Optional parameters:None.

    Sample output:

    Does not return output.

    Examples...

     

    setAttribute_jmx

    Set the attribute value for the name that you provide.

    Required parameters:

    object name

    Object name of the MBean of interest. (ObjectName)

    attribute

    Name of the attribute to set. (Attribute)

    Optional parameters:None.

    Sample output:

    Does not return output.

    Examples...

     

    setAttributes

    Set the attribute values for the object names that you provide.

    Required parameters:

    object name

    Object name of the MBean of interest. (String)

    attributes

    Names of the attributes to set. (java.lang.String[] or java.lang.Object[])

    Optional parameters:None.

    Sample output:

    List of object names that are successfully set by the command invocation

    '[traceSpecification com.ibm.ws.*=all=enabled]'

    Examples...

     

    setAttributes_jmx

    Set the attribute values for the object names that you provide.

    Required parameters:

    object name

    Object name of the MBean of interest. (String)

    attributes

    Names of the attributes to set. (javax.management.AttributeList)

    Optional parameters:None.

    Sample output:

    Attribute list of object names that are successfully set by the command invocation

    '[traceSpecification com.ibm.ws.*=all=enabled]'

    Examples...

     

    startServer

    Start the specified appserver by locating it in the configuration. This command uses the default wait time. Use the following guidelines to determine which parameters to use:

    Required parameters:

    server name

    Name of the server to start. (java.lang.String)

    Optional parameters:

    node name

    Name of the node of interest. (java.lang.String)

    wait time

    Number of seconds that the start process waits for the server to start. The default wait time is 1200 seconds. (java.lang.String)

    Sample output: The command returns a message to indicate if the server starts successfully...

    '[traceSpecification com.ibm.ws.*=all=enabled]'

    Examples...

    Jacl...

    Jython...

     

    stopServer

    Stop the stopServer command to stop the specified appserver. When the stopServer command runs without the immediate or terminate flags, the server finishes any work in progress, but does not accept any new work once it begins the stop process. Use the following options to determine which parameters to use:

    Required parameters:

    server name

    Name of the server to start. (java.lang.String)

    Optional parameters:

    node name

    Name of the node of interest. (java.lang.String)

    immediate flag

    Specifies to stop the server immediately if the value is set to immediate. If specify the immediate flag, the server does not finish processing any work in progress, does not accept any new work, and ends the server process. (java.lang.String)

    terminate flag

    Specifies that the server process should be terminated by the operating system. (String)

    Sample output: The command returns a message to indicate if the server stops successfully...

    WASX7337I: Invoked stop for server "server1" Waiting for stop completion.
    'WASX7264I: Stop completed for server "server1" on node "myNode"'

    Examples...

    Jacl...

    Jython...

     

    testConnection

    Test a data source connection. This command works with the data source residings in the configuration repository. If the data source to be tested is in the temporary workspace that holds the update to the repository, save the update to the configuration repository before running this command. Use this command with the configuration ID that corresponds to the data source and the WAS40DataSource object types.

    Required parameters:

    configuration ID

    Configuration ID of the data source object of interest. (java.lang.String)

    Optional parameters:None.

    Sample output:

    Message that indicates a successful connection or a connection with a warning. If the connection fails, an exception is created from the server indicating the error. For example:

    WASX7217I: Connection to provided datasource was successful.

    Examples...

     

    trace

    Set the trace spec for the scripting process to the value specified.

    Required parameters:

    trace spec

    Trace to enable for the scripting process. (java.lang.String)

    Optional parameters: None.

    Sample output:

    The command does not return output.

    Examples...





     

    Related tasks


    Use AdminControl for scripted administration