Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use the wsadmin scripting AdminControl object for scripted administration
Modify attributes on running objects using the wsadmin scripting tool
Use scripting and wsadmin.sh to modify attributes on running objects.
See the topic on starting the wsadmin scripting client.
We can run a script that modifies attributes on running objects.
Procedure
- Obtain the name of the running object.
Run the completeObjectName command with the name parameter.
### Jacl
$AdminControl completeObjectName name### Jython
AdminControl.completeObjectName(name)
- Set the ts1 variable to the running object.
The following scripts set the ts1 variable to the result of the completeObjectName commands.
### Jacl
set ts1 [$AdminControl completeObjectName name]### Jython
ts1 = AdminControl.completeObjectName(name)
- Modify the running object.
The following scripts use the setAttribute command to set the ts1 variable ring buffer size to 10.
### Jacl
$AdminControl setAttribute $ts1 ringBufferSize 10### Jython
AdminControl.setAttribute(ts1, 'ringBufferSize', 10)We can also modify multiple attribute name and value pairs, for example:
### Jacl
set ts1 [$AdminControl completeObjectName type=TraceService,process=server1,*] $AdminControl setAttributes $ts1 {{ringBufferSize 10} {traceSpecification com.ibm.*=all=disabled}}
Jython list:
ts1 = AdminControl.completeObjectName('type=TraceService,process=server1,*') AdminControl.setAttributes(ts1, [['ringBufferSize', 10], ['traceSpecification', 'com.ibm.*=all=disabled']])### Jython string
ts1 =AdminControl.completeObjectName('type=TraceService,process=server1,*') AdminControl.setAttributes(ts1, '[[ringBufferSize 10] [traceSpecification com.ibm.*=all=disabled]]')
The new attribute values are returned to the command line.
Start the wsadmin scripting client using wsadmin.sh
Turning traces on and off in servers processes using scripting
Use the wsadmin scripting AdminControl object for scripted administration
Performing operations on running objects using wsadmin.sh
Related
Example: Identifying running objects using wsadmin.sh
Commands for the AdminControl object using wsadmin.sh