Example: Disabling a service using wsadmin
An example disabling the trace service of a configured server follows. You can modify this example to disable a different service.
- Identify the server and assign it to the server variable.
set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]Example output:
server1(cells/mycell/nodes/mynode/servers/server1:server.xml#Server_1)- List all the services belonging to the server and assign them to the services variable.
set services [$AdminConfig list Service $server]This command returns a list of 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)- Identify the trace service and assign it to the traceService variable.
Since trace service is the 8th element in the list, retrieve this element by using index 7.
set traceService [lindex $services 7]Example output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#TraceService_1)- Disable the trace service by modifying the enable attribute.
$AdminConfig modify $traceService {{enable false}}- Save the changes with the following command:
$AdminConfig save