User Tools

Site Tools


This is an old revision of the document!

Scripting with wsadmin


print Help.message('WASX7115E')
print Help.Adminapp()


Use the AdminApp object to manage applications.

List installed Applications

print AdminApp.list()
print AdminApp.list("WebSphere:cell=myCell,node=myNode,server=myServer")
print AdminApp.list("WebSphere:cell=myCell,node=myNode")

Edit application configuration

Beware, the application will restart on save:

AdminApp.edit('appname', ['options']) # or
AdminApp.edit('appname', '[options]')




The AdminControl scripting object is used for operational control

The WebSphere Application Server ObjectName class uniquely identifies running objects. The ObjectName class consists of the following elements:

  • The domain name WebSphere.
  • Several key properties, for example:
    • type - Indicates the type of object that is accessible through the MBean, for example, ApplicationServer, and EJBContainer.
    • name - Represents the display name of the particular object, for example, MyServer.
    • node - Represents the name of the node on which the object runs.
    • process - Represents the name of the server process in which the object runs.
    • mbeanIdentifier - Correlates the MBean instance with corresponding configuration data.

When ObjectName classes are represented by strings, they have the following pattern:


For example, you can specify

WebSphere:name="My Server",type=ApplicationServer,node=n1,*

to specify an application server named My Server on node n1. (The asterisk (*) is a wildcard, used so that you do not have to specify the entire set of key properties.) The AdminControl commands that take strings as parameters expect strings that look like this example when specifying running objects (MBeans). You can obtain the object name for a running object with the getObjectName command.

Specify MBeans

With a partial object name (template), you can use the completeObjectName and queryNames methods.

CompleteObjectName retrurns the first match as a string.


QueryNames returns a list of all the objects, separated by \n


Find MBeans attributes and operations

To find information on a running MBean supported attributes and operations, use Help.attributes and Help.operations.

print Help.attributes(srv)
print Help.operations(srv)
print Help.attributes(srv,'pid')
print Help.operations(srv,'stop')

Performing operations and modifying attributes on MBeans

To invoke an operations, use AdminControl.invoke(mbean, operation)


To modify an attribute, use AdminControl.setAttribute(mbean, attribute, value)

AdminControl.setAttribute(ts1, 'ringBufferSize', 10)
AdminControl.setAttributes(srv, [['ringBufferSize', 10], ['traceSpecification', '*=all=disabled']])

Force node synchronization

Use AdminControl.invoke(node, 'sync'):

node = AdminControl.completeObjectName('type=NodeSync,node=nbk02476Node01,*')
AdminControl.invoke(node, 'sync')


Save configuration
middleware/wsadmin.1235577118.txt · Last modified: 2009/02/25 15:51 by ap

Informativa sui cookie