+

Search Tips   |   Advanced Search

 

Modify attributes on running objects with the wsadmin tool

 

Use scripting and the wsadmin tool to modify attributes on running objects. Before starting this task, the wsadmin tool must be running. See the Start the wsadmin scripting client article for more information.

 

Overview

Perform the following steps to modify attributes on running objects:

 

Procedure

  1. Obtain the name of the running object...

    • Use Jacl:

      $AdminControl completeObjectName name
      

    • Use Jython:

      AdminControl.completeObjectName(name)
      

    where:

    $ Jacl operator for substituting a variable name with its value
    AdminControl object that enables the manipulation of MBeans that run in a WAS process
    completeObjectName AdminControl command
    name 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.

  2. Set the ts1 variable to the running object...

    • Use Jacl:

      set ts1 [$AdminControl completeObjectName name]
      

    • Use Jython:

      ts1 = AdminControl.completeObjectName(name)
      

    where:

    set Jacl command
    ts1 variable name
    $ Jacl operator for substituting a variable name with its value
    AdminControl object that enables the manipulation of MBeans running in a WAS process
    completeObjectName AdminControl command
    name 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.

  3. Modify the running object...

    • Use Jacl:

      $AdminControl setAttribute $ts1 ringBufferSize 10
      

    • Use Jython:

      AdminControl.setAttribute(ts1, 'ringBufferSize', 10)
      

    where:

    $ Jacl operator for substituting a variable name with its value
    AdminControl object that enables the manipulation of MBeans running in a WAS process
    setAttribute AdminControl command
    ts1 evaluates to the ID of the server specified in step number 3
    ringBufferSize attribute of modify objects
    10 value of the ringBufferSize attribute

    You can also modify multiple attribute name and value pairs...

    • Use Jacl:

      set ts1 [$AdminControl completeObjectName type=TraceService,process=server1,*]
      $AdminControl setAttributes $ts1 {{ringBufferSize 10} {traceSpecification com.ibm.*=all=disabled}}
      

    • Use Jython list:

      ts1 = AdminControl.completeObjectName('type=TraceService,process=server1,*')
      AdminControl.setAttributes(ts1, [['ringBufferSize', 10], ['traceSpecification',  'com.ibm.*=all=disabled']])
      

    • Use 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.



Turning traces on and off in servers processes using scripting
Use the AdminControl object for scripted administration
Performing operations on running objects using the wsadmin tool

 

Related Reference


Example: Identifying running objects
Commands for the AdminControl object