+

Search Tips   |   Advanced Search

Disable the trace service using scripting


We can disable the services of a configured server with scripting and wsadmin.

Perform the following steps to disable the trace service of a configured server. We can modify this example to disable a different service.

 

  1. Launch the wsadmin scripting tool using the Jython scripting language.

  2. Identify the server and assign it to the server variable. For example:

    • Jacl...

      set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]

    • Jython...

      server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print server

    For example...

    server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)

  3. List all the services belonging to the server and assign them to the services variable.

    The following example returns a list of services:

    • Jacl...

      set services [$AdminConfig list Service $server]

    • Jython...

      services = AdminConfig.list('Service', server) print services

    For example...

    (cells/mycell/nodes/mynode/servers/server1|server.xml#AdminService_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#DynamicCache_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#MessageListenerService_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#ObjectRequestBroker_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#PMIService_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#RASLoggingService_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#SessionManager_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#TraceService_1) (cells/mycell/nodes/mynode/servers/server1|server.xml#TransactionService_1)

  4. Identify the trace service and assign it to the traceService variable.

    Since trace service is the seventh element in the list, retrieve this element by using index 6.

    • Jacl...

      set traceService [$AdminConfig list TraceService $server]

    • Jython...

      traceService = AdminConfig.list('TraceService', server) print traceService

    For example...

    (cells/mycell/nodes/mynode/servers/server1|server.xml#TraceService_1)

  5. Disable the trace service by modifying the enable attribute. For example:

    • Jacl...

      $AdminConfig modify $traceService {{enable false}}

    • Jython...

      AdminConfig.modify(traceService, [['enable', 'false']])

  6. Save the configuration changes...

    AdminConfig.save()

  7. In a network deployment environment only, synchronize the node. Use the syncActiveNode or syncNode scripts in the AdminNodeManagement script library to propagate the configuration changes to node or nodes.

    • Use the syncActiveNodes script to propagate the changes to each node in the cell...

      AdminNodeManagement.syncActiveNodes()

    • Use the syncNode script to propagate the changes to a specific node, as the following example demonstrates:

      AdminNodeManagement.syncNode("myNode")

 

Related tasks


Use the AdminConfig object for scripted administration

 

Related


Server settings configuration scripts
Commands for the AdminConfig object