Use the AdminControl object to invoke operational commands that deal with running objects in the WebSphere 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.
Parameters: | name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set serverON [$AdminControl completeObjectName node=mynode,type=Server,*]
Parameters: | name -- java.lang.String; attribute -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl getAttribute $objNameString processType
Parameters: | name -- ObjectName; attribute -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] set objName [java::new javax.management.ObjectName $objNameString] $AdminControl getAttribute_jmx $objName processType
Parameters using Jacl: | name -- String; attributes -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl getAttributes $objNameString "cellName nodeName"
Parameters: | name -- ObjectName; attributes -- java.lang.String[] |
Return Type: | javax.management.AttributeList |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName WebSphere:type=Server,*] set objName [$AdminControl makeObjectName $objectNameString] set attrs [java::new {String[]} 2 {cellName nodeName}] $AdminControl getAttributes_jmx $objName $attrs
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getCell
Example output:
Mycell
Parameters: | name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set serverConfigId [$AdminControl getConfigId node=SY1,type=Server,*]
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getDefaultDomain
Example output:
WebSphere
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getDomainName
Example output:
WebSphere
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getHost
Example output:
myhost
Parameters: | none |
Return Type: | java.lang.Integer |
Example usage:
Using Jacl:
$AdminControl getMBeanCount
Example output:
114
Parameters: | name -- ObjectName |
Return Type: | javax.management.MBeanInfo |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objectNameString] $AdminControl getMBeanInfo_jmx $objName
Example output:
javax.management.modelmbean.ModelMBeanInfoSupport@10dd5f35
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getNode
Example output:
Myhost
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getPort
Example output:
8877
This command incorrectly assumes the availability of a configuration service when running in connected mode.
Parameters: | configId -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set ds [lindex [$AdminConfig list DataSource] 0] $AdminControl getPropertiesForDataSource $ds
Example output:
WASX7389E: Operation not supported - getPropertiesForDataSource command is not supported.
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl getType
Example output:
SOAP
Parameters: | none |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl help
Example output:
WASX7027I: The AdminControl object enables the manipulation of MBeans running in a WebSphere server process. The number and type of MBeans available to the scripting client depends on the server to which the client is connected. If the client is connected to a Deployment Manager, then all the MBeans running in the Deployment Manager are visible, as are all the MBeans running in the Node Agents connected to this Deployment Manager, and all the MBeans running in the application servers on those nodes. The following commands are supported by AdminControl; more detailed information about each of these commands is available by using the "help" command of AdminControl and supplying the name of the command as an argument. Note that many of these commands support two different sets of signatures: one that accepts and returns strings, and one low-level set that works with JMX objects like ObjectName and AttributeList. In most situations, the string signatures are likely to be more useful, but JMX-object signature versions are supplied as well. Each of these JMX-object signature commands has "_jmx" appended to the command name. Hence there is an "invoke" command, as well as a "invoke_jmx" command. completeObjectName Return a String version of an object name given a template name getAttribute_jmx Given ObjectName and name of attribute, returns value of attribute getAttribute Given String version of ObjectName and name of attribute, returns value of attribute getAttributes_jmx Given ObjectName and array of attribute names, returns AttributeList getAttributes Given String version of ObjectName and attribute names, returns String of name value pairs getCell returns the cell name of the connected server getConfigId Given String version of ObjectName, return a config id for the corresponding configuration object, if any. getDefaultDomain returns "WebSphere" getDomainName returns "WebSphere" getHost returns String representation of connected host getMBeanCount returns number of registered beans getMBeanInfo_jmx Given ObjectName, returns MBeanInfo structure for MBean getNode returns the node name of the connected server getPort returns String representation of port in use getType returns String representation of connection type in use help Show help information invoke_jmx Given ObjectName, name of command, array of parameters and signature, invoke command on MBean specified invoke Invoke a command on the specified MBean isRegistered_jmx true if supplied ObjectName is registered isRegistered true if supplied String version of ObjectName is registered makeObjectName Return an ObjectName built with the given string queryNames_jmx Given ObjectName and QueryExp, retrieves set of ObjectNames that match. queryNames Given String version of ObjectName, retrieves String of ObjectNames that match. reconnect reconnects with server setAttribute_jmx Given ObjectName and Attribute object, set attribute for MBean specified setAttribute Given String version of ObjectName, attribute name and attribute value, set attribute for MBean specified setAttributes_jmx Given ObjectName and AttributeList object, set attributes for the MBean specified startServer Given the name of a server, start that server. stopServer Given the name of a server, stop that server. testConnection Test the connection to a DataSource object trace Set the wsadmin trace specification
Parameters: | command -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl help getAttribute
Example output:
WASX7043I: command: getAttribute Arguments: object name, attribute Description: Returns value of "attribute" for the MBean described by "object name."
Parameters: | name -- java.lang.String; operationName -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString stop
Parameters: | name -- java.lang.String; operationName -- java.lang.String; params -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString appendTraceString com.ibm.*=all=enabled
Parameters: | name -- java.lang.String; operationName -- java.lang.String; params -- java.lang.String; sigs -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl invoke $objNameString appendTraceString com.ibm.*=all=enabled java.lang.String
Parameters: | name -- ObjectName; operationName -- java.lang.String; params -- java.lang.Object[]; signature -- java.lang.String[] |
Return Type: | java.lang.Object |
Example usage:
set objNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [java::new javax.management.ObjectName $objNameString] set parms [java::new {java.lang.Object[]} 1 com.ibm.ejs.sm.*=all=disabled] set signature [java::new {java.lang.String[]} 1 java.lang.String] $AdminControl invoke_jmx $objName appendTraceString $parms $signature
Parameters: | name -- java.lang.String |
Return Type: | Boolean |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=Server,*] $AdminControl isRegistered $objNameString
Parameters: | name -- ObjectName |
Return Type: | Boolean |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objNameString] $AdminControl isRegistered_jmx $objName
Parameters: | name -- java.lang.String |
Return Type: | javax.management.ObjectName |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName type=Server,node=mynode,*] set objName [$AdminControl makeObjectName $objNameString]
Parameters: | name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl queryNames WebSphere:type=Server,*
Example output:
WebSphere:cell=BaseApplicationServerCell,name=server1,mbeanIdentifier=server1,type=Server,node=mynode,process=server1
Parameters: | name -- javax.management.ObjectName;query -- javax.management.QueryExp |
Return Type: | java.util.Set |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName type=Server,*] set objName [$AdminControl makeObjectName $objNameString] set null [java::null] $AdminControl queryNames_jmx $objName $null
Example output:
[WebSphere:cell=BaseApplicationServerCell,name=server1,mbeanIdentifier=server1,type=Server,node=mynode,process=server1]
Parameters: | none |
Return Type: | none |
Example usage:
Using Jacl:
$AdminControl reconnect
Example output:
WASX7074I: Reconnect of SOAP connector to host myhost completed.
Parameters: | name -- java.lang.String; attributeName -- java.lang.String; attributeValue -- java.lang.String |
Return Type: | none |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] $AdminControl setAttribute $objNameString traceSpecification com.ibm.*=all=disabled
Parameters: | name -- ObjectName; attribute -- javax.management.Attribute |
Return Type: | none |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [$AdminControl makeObjectName $objectNameString] set attr [java::new javax.management.Attribute traceSpecification com.ibm.*=all=disabled] $AdminControl setAttribute_jmx $objName $attr
Parameters using Jacl: | name -- String; attributes -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set objNameString [$AdminControl completeObjectName WebSphere:type=TracesService,*] $AdminControl setAttributes $objNameString {{traceSpecification com.ibm.ws.*=all=enabled}}
Parameters: | name -- ObjectName; attributes -- javax.management.AttributeList |
Return Type: | javax.management.AttributeList |
Example usage:
Using Jacl:
set objectNameString [$AdminControl completeObjectName WebSphere:type=TraceService,*] set objName [$AdminControl makeObjectName $objectNameString] set attr [java::new javax.management.Attribute traceSpecification com.ibm.ws.*=all=enabled] set alist [java::new javax.management.AttributeList] $alist add $attr $AdminControl setAttributes_jmx $objName $alist
Parameters: | server name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl startServer server1
Parameters: | server name -- java.lang.String, wait time -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl startServer server1 100
Parameters: | server name -- java.lang.String, node name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl startServer server1 myNode
Parameters: | server name -- java.lang.String, node name -- java.lang.String, wait time -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl startServer server1 myNode 100
Parameters: | server name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl stopServer server1
Parameters: | server name -- java.lang.String, immediate flag -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl stopServer server1 immediate
Parameters: | server name -- java.lang.String, node name -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl stopServer server1 myNode
Parameters: | server name -- java.lang.String, node name -- java.lang.String, immediate flag -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl stopServer server1 myNode immediate
Parameters: | server name, node name, terminate flag |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
$AdminControl stopServer server1 myNode terminate
Parameters: | configId -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set ds [lindex [$AdminConfig list DataSource] 0] $AdminControl testConnection $ds
Example output:
WASX7217I: Connection to provided datasource was successful.
This command can give false results and does not work when connected to a NodeAgent. As of V5.0.2, the preferred way to test a Datasource connection is with the testConnection command passing in the DataSource configId as the only parameter.
Parameters: | configId -- java.lang.String; props -- java.lang.String |
Return Type: | java.lang.String |
Example usage:
Using Jacl:
set ds [lindex [$AdminConfig list DataSource] 0] $AdminControl testConnection $ds {{prop1 val1}}
Example output:
WASX7390E: Operation not supported - testConnection command with config id and properties arguments is not supported. Use testConnection command with config id argument only.
Parameters: | traceSpec -- java.lang.String |
Return Type: | none |
Example usage:
Using Jacl:
$AdminControl trace com.ibm.ws.scripting.*=all=enabled