Manage generic servers using scripting
Use WAS to define, start, stop, and monitor generic servers.
Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.
A generic server is a server that the WAS manages but did not supply.
- To define a generic server, use the following example:
- Jacl...
$AdminTask createGenericServer mynode {-name generic1 -ConfigProcDef {{"/usr/bin/myStartCommand" "arg1 arg2" "" "" "/tmp/workingDirectory" "/tmp/stopCommand" "argy argz"}}} $AdminConfig save- Jython...
AdminTask.createGenericServer('mynode', '[-name generic1 -ConfigProcDef [[c:\tmp\myStartCommand.exe "a b c" "" "" C:\tmp\myStopCommand "x y z"]]]') AdminConfig.save()
- To start a generic server, use the launchProcess parameter...
- Jacl...
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent] $AdminControl invoke $nodeagent launchProcess generic1- Jython...
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent') AdminControl.invoke(nodeagent, 'launchProcess', 'generic1')
For example...
trueorfalse- To stop a generic server, use the terminate parameter...
- Jacl...
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent] $AdminControl invoke $nodeagent terminate generic1- Jython...
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent') AdminControl.invoke(nodeagent, 'terminate', 'generic1')
For example...
trueorfalse- To monitor the server state, use the getProcessStatus parameter...
- Jacl...
$AdminControl invoke $nodeagent getProcessStatus generic1Jython...
AdminControl.invoke(nodeagent, 'getProcessStatus', 'generic1')
For example...
RUNNINGorSTOPPED
Related tasks
Use the AdminConfig object for scripted administration
Use AdminControl for scripted administration
Related
Commands for the AdminConfig object
Commands for AdminControl