+

Search Tips   |   Advanced Search

Commands for the AdminControl object using wsadmin scripting

Use the AdminControl object to invoke operational commands that manage objects for the application server.

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 using strings for parameters. In addition to operational commands, the AdminControl object supports some utility commands for tracing, reconnecting with a server, and converting data types.

When using the commands available in the AdminControl object in large topologies, query and search with process=dmgr and type=Cluster. This method of searching is more efficient, less time consuming, and avoids searching all nodes.

The following commands are available for the AdminControl object:


completeObjectName

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command does not return output.

Examples


getAttribute

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

If we use the getAttribute command to determine the state of an application, one of the following values is returned:

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the value of the attribute that you query, as the following example displays:

Examples


getAttribute_jmx

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the value of the attribute that you query, as the following example displays:

Examples


getAttributes

Return the attribute values for the names provided.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the value of the attribute that you query, as the following example displays:

Examples


getAttributes_jmx

Return the attribute values for the names provided.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns an attribute list.

Examples


getCell

Return the name of the connected cell.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns the cell name that you query:

Examples


getConfigId

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the configuration ID of interest.

Examples


getDefaultDomain

Return the default domain name from the server.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a string containing the default domain name of interest:

Examples


getDomainName

Return the domain name from the server.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a string containing the domain name of interest:

Examples


getHost

Return the name of our host.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a string containing the name of the host of interest:

Examples


getMBeanCount

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

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns an integer value containing the number of MBeans that are registered in the server:

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:

Optional parameters: None.

Sample output

The command returns a javax.management.MBeanInfo object:

Examples


getNode

Return the name of the connected node.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a string containing the name of the node:

Examples


getObjectInstance

Return the object instance that matches the input object name.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns the object instance that matches the input object name:

Examples


getPort

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

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns the port number of the port the system uses to establish the scripting connection:

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.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns the following message:

Examples


getType

Return the connection type used for the scripting connection.

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a string containing the connection type for the scripting connection, as the following example displays:

Examples


help

Return general help text for the AdminControl object.

Target object: None.

Required parameters: None.

Optional parameters:

Sample output

The command returns a string that details specific options for the help command, as the following example displays:

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

Examples


invoke

Invoke a specific MBean operation based on the number of parameters that operation requires. If this constraint is not sufficient to select a unique operation, use invoke_jmx. The supplied parameters are converted to the object types required by the selected operation's signature before the operation is invoked. Any returned value is converted to its string representation.

Target object: None.

Required parameters:

Optional parameters:

Sample output

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

Examples


invoke_jmx

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

Target object: None.

Required parameters:

Optional parameters:

Sample output

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

Examples


isRegistered

Determine if a specific object name is registered.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a boolean value for the object of interest. If the ObjectName value is registered in the server, then the value is 1:

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.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a boolean value for the object of interest. If the ObjectName value is registered in the server, then the value is true:

Examples


makeObjectName

Create an ObjectName value 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 WebSphere Application Server string appends to the name.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns an Objectname object constructed from the object name string.

Examples


queryMBeans

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

Target object: None.

Required parameters:

Optional parameters:

Sample output

The command returns a list of object instances for the object name specified, as the following example displays:

Examples


queryNames

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the ObjectNames that match the input object name, as the following example displays:

Examples


queryNames_jmx

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a string containing the ObjectNames that match the input object name, as the following example displays:

Examples


reconnect

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

Target object: None.

Required parameters: None.

Optional parameters: None.

Sample output

The command returns a message that displays the status of the operation:

Examples


setAttribute

Set the attribute value for the name that we provide.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns does not return output.

Examples


setAttribute_jmx

Set the attribute value for the name that we provide.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns does not return output.

Examples


setAttributes

Set the attribute values for the object names provided.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a list of object names that are successfully set by the command invocation, as the following example displays:

Examples


setAttributes_jmx

Set the attribute values for the object names provided.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns an attribute list of object names that are successfully set by the command invocation:

Examples


startServer

Start the specified application server by locating it in the configuration. This command uses the default wait time. To determine which parameters to use:

Target object: None.

Required parameters:

Optional parameters:

Sample output

Server launched. Waiting for initialization status. Server server1 open for e-business; process id is 1932.

Examples

Use Jacl:

Use Jython:


stopServer

Stop the specified application server. 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:

An error message is issued if only specify the server name when we attempt to stop that server.

Target object: None.

Required parameters:

Optional parameters:

Sample output

The command returns a message to indicate if the server stops successfully, as the following example displays:

Examples

Use Jacl:

Use Jython:


testConnection

Test a data source connection. This command works with the data source that resides in the configuration repository. If the data source to be tested is in the temporary workspace that holds the update to the repository, we must 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.

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command returns a 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:

Examples


trace

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

Target object: None.

Required parameters:

Optional parameters: None.

Sample output

The command does not return output.

Examples

  • wsadmin AdminControl