WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Disabling services using scripting

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

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

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

Procedure

  1. Identify the server and assign it to the server variable. For example:
    • Using Jacl:

      set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
    • Using Jython:
      server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
      print server
    Example output:
    server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
  2. List all the services belonging to the server and assign them to the services variable. The following example returns a list of services:
    • Using Jacl:

      set services [$AdminConfig list Service $server]
    • Using Jython:
      services = AdminConfig.list('Service', server)
      print services
    Example output:
    (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)
  3. Identify the trace service and assign it to the traceService variable.

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

    • Using Jacl:

      set traceService [$AdminConfig list TraceService $server]
    • Using Jython:
      traceService = AdminConfig.list('TraceService', server)
      print traceService
    Example output:
    (cells/mycell/nodes/mynode/servers/server1|server.xml#TraceService_1)
  4. Disable the trace service by modifying the enable attribute. For example:
    • Using Jacl:

      $AdminConfig modify $traceService {{enable false}}
    • Using Jython:
      AdminConfig.modify(traceService, [['enable', 'false']])
  5. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  6. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



Related tasks
Using the AdminConfig object for scripted administration
Related reference
Commands for the AdminConfig object
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/txml_disableservice.html

© Copyright IBM Corporation 2004, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)