Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Manage servers and nodes with scripting
Manage generic servers using scripting
We can use WAS to define, start, stop, and monitor generic servers.
A generic server is a server that the WAS manages but did not supply.
Procedure
- To define a generic server:
### 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, for example:
### Jacl
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent] $AdminControl invoke $nodeagent launchProcess generic1### Jython
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent') AdminControl.invoke(nodeagent, 'launchProcess', 'generic1')
Example output:
trueorfalse
To stop a generic server, use the terminate parameter, for example:
### Jacl
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent] $AdminControl invoke $nodeagent terminate generic1### Jython
nodeagent = AdminControl.queryNames ('*:*,type=NodeAgent') AdminControl.invoke(nodeagent, 'terminate', 'generic1')
Example output:
trueorfalse
To monitor the server state, use the getProcessStatus parameter, for example:
### Jacl
$AdminControl invoke $nodeagent getProcessStatus generic1### Jython
AdminControl.invoke(nodeagent, 'getProcessStatus', 'generic1')
Example output:
RUNNINGorSTOPPED
Use the wsadmin scripting AdminConfig object for scripted administration
Use the wsadmin scripting AdminControl object for scripted administration
Start the wsadmin scripting client using wsadmin.sh
Related
Commands for the AdminConfig object using wsadmin.sh
Commands for the AdminControl object using wsadmin.sh
Use wsadmin scripting with Jython