Use scripting and the wsadmin tool to modify attributes on running objects.
Before starting this task, the wsadmin tool must be running. See the topic on starting the wsadmin scripting client.
You can run a script that modifies attributes on running objects.
Run the completeObjectName command with the name parameter.
$AdminControl completeObjectName name
AdminControl.completeObjectName(name)
Element | Description |
---|---|
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans that run in a WebSphere® Application Server process |
completeObjectName | is an AdminControl command |
name | is a fragment of the object name that is used to find the matching object name. For example: type=TraceService,node=mynode,*. This value can be any valid combination of domain and key properties, for example, type, name, cell, node, process, and so on. |
The following scripts set the ts1 variable to the result of the completeObjectName commands.
set ts1 [$AdminControl completeObjectName name]
ts1 = AdminControl.completeObjectName(name)
Element | Description |
---|---|
set | is a Jacl command |
ts1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans running in a WebSphere Application Server process |
completeObjectName | is an AdminControl command |
name | is a fragment of the object name. It is used to find the matching object name. For example: type=TraceService,node=mynode,*. It can be any valid combination of domain and key properties, for example, type, name, cell, node, process, and so on. |
The following scripts use the setAttribute command to set the ts1 variable ring buffer size to 10.
$AdminControl setAttribute $ts1 ringBufferSize 10
AdminControl.setAttribute(ts1, 'ringBufferSize', 10)
Element | Description |
---|---|
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans running in a WebSphere Application Server process |
setAttribute | is an AdminControl command |
ts1 | evaluates to the ID of the server specified in step number 3 |
ringBufferSize | is an attribute of modify objects |
10 | is the value of the ringBufferSize attribute |
set ts1 [$AdminControl completeObjectName type=TraceService,process=server1,*]
$AdminControl setAttributes $ts1 {{ringBufferSize 10}
{traceSpecification com.ibm.*=all=disabled}}
ts1 = AdminControl.completeObjectName('type=TraceService,process=server1,*')
AdminControl.setAttributes(ts1, [['ringBufferSize', 10],
['traceSpecification', 'com.ibm.*=all=disabled']])
ts1 =AdminControl.completeObjectName('type=TraceService,process=server1,*')
AdminControl.setAttributes(ts1, '[[ringBufferSize 10]
[traceSpecification com.ibm.*=all=disabled]]')