Manage generic servers using scripting
Use WebSphere Application Server to define, start, stop, and monitor generic servers.
A generic server is a server that the WAS manages but did not supply.
Tasks
- 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(iSeries)
$AdminTask createGenericServer mynode {-name generic1 -ConfigProcDef {{"/mydir1/myStartCommand" "arg1 arg2" "" "" "/tmp/workingDirectory" "/mydir2/stopCommand" "argy argz"}}} $AdminConfig save- Jython:
(Dist)
AdminTask.createGenericServer('mynode', '[-name generic1 -ConfigProcDef [[c:/tmp/myStartCommand.exe "a b c" "" "" C:/tmp/myStopCommand "x y z"]]]') AdminConfig.save()(ZOS)
AdminTask.createGenericServer('mynode', '[-name generic1 -ConfigProcDef [[/tmp/myStartCommand.exe "a b c" "" "" /tmp/myStopCommand "x y z"]]]') AdminConfig.save()(iSeries)
AdminTask.createGenericServer('mynode', '[-name generic1 -ConfigProcDef [[/mydir1/myStartCommand "a b c" "" "" /tmp/workingDirectory /mydir2/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 generic1Use Jython:
AdminControl.invoke(nodeagent, 'getProcessStatus', 'generic1')
Example output:
RUNNINGorSTOPPED
wsadmin AdminConfig wsadmin AdminControl Start the wsadmin scripting client Commands for the AdminConfig object Commands for the AdminControl object Use wsadmin scripting with Jython