You can use scripting and the wsadmin tool to configure processes.
Using Jacl:
$AdminTask setProcessDefinition {-interactive}
AdminTask.setProcessDefinition (['-interactive'])
Using Jacl:
set s1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
s1 = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print s1
set | is a Jacl command |
s1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
getid | is an AdminConfig command |
Cell | is the object type |
mycell | is the name of the object that will be modified |
Node | is the object type |
mynode | is the name of the object that will be modified |
Server | is the object type |
server1 | is the name of the object that will be modified |
a Jython command |
server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
Using Jacl:
set processDef [$AdminConfig list JavaProcessDef $s1] set processDef [$AdminConfig showAttribute $s1 processDefinitions]
set processDefs [$AdminConfig list JavaProcessDef $s1] set controllerProcessDef [lindex $processDefs 1] set servantProcessDef [lindex $processDefs 1]
Using Jython:
processDef = AdminConfig.list('JavaProcessDef', s1) print processDef processDef = AdminConfig.showAttribute(s1, 'processDefinitions')
processDefs = AdminConfig.list('JavaProcessDef', s1) # get line separator import java lineSeparator = java.lang.System.getProperty('line.separator') arrayPDs = processDefs.split(lineSeparator) controllerProcessDef = arrayPDs[0] servantProcessDef = arrayPDs[1] print controllerProcessDef print servantProcessDef
Example output:
(cells/mycell/nodes/mynode/servers/server1|server.xml#JavaProcessDef_1)
(cells/mycell/nodes/mynode/servers/server1:server.xml#JavaProcessDef_1) (cells/mycell/nodes/mynode/servers/server1:server.xml#JavaProcessDef_2)
On distributed systems, the following example changes
the working directory.
On z/OS systems, the following
example shows how to change the process definition of the servant region.
You can change the process definition of the controller region by substituting
controllerProcessDef for servantProcessDef .
Using Jacl:
$AdminConfig modify $processDef {{workingDirectory c:/temp/user1}}
$AdminConfig modify $servantProcessDef {{workingDirectory /temp/user1}}
$AdminConfig modify $processDef {{workingDirectory /home/myProfile/temp/user1}}
Using Jython:
AdminConfig.modify(processDef, [['workingDirectory', 'c:/temp/user1']])
AdminConfig.modify(servantProcessDef, [['workingDirectory', '/temp/user1']])
AdminConfig.modify(processDef, [['workingDirectory', '/home/myProfile/temp/user1']])
Using Jacl:
set errFile [list stderrFilename \${LOG_ROOT}/server1/new_stderr.log] set attr [list $errFile] $AdminConfig modify $processDef [subst {{ioRedirect {$attr}}}]
set errFile [list stderrFilename \${LOG_ROOT}/server1/new_stderr.log] set attr [list $errFile] $AdminConfig modify $servantProcessDef [subst {{ioRedirect {$attr}}}]
Using Jython:
errFile = ['stderrFilename', '\${LOG_ROOT}/server1/new_stderr.log'] attr = [errFile] AdminConfig.modify(processDef, [['ioRedirect', [attr]]])
errFile = ['stderrFilename', '${LOG_ROOT}/server1/new_stderr.log'] attr = [errFile] AdminConfig.modify(servantProcessDef, [['ioRedirect', attr]])
Using Jacl:
$AdminConfig modify $processDef {{execution {{processPriority 15}}}}
Using Jython:
AdminConfig.modify(processDef, [['execution', [['processPriority', 15]]]])
Using Jacl:
$AdminConfig modify $processDef {{monitoringPolicy {{maximumStartupAttempts 1}}}}
Using Jython:
AdminConfig.modify(processDef, [['monitoringPolicy', [['maximumStartupAttempts', 1]]]])
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience. This feature requires Internet access. Most of the following links will take you to information that is not part of the formal product documentation and is provided "as is." Some of these links go to non-IBM Web sites and are provided for your convenience only and do not in any manner serve as an endorsement by IBM of those Web sites, the material thereon, or the owner thereof. |