manageODR.py script

You can use the manageODR.py script to manage custom logging and create a cluster of on demand routers (ODR).

Location

The manageODR.py script is located in the app_server_root/bin directory. Before running this script, ensure that you have the environment variable WAS_HOME configured to point to the directory of your WebSphere® installation.

Operations

You can perform the following operations with the manageODR.py script:
  • convertToCluster <node:odr> <cluster>: Convert an existing ODR on node node with name odr to an ODR cluster named <cluster>
  • addToCluster <node:odr> <cluster>: Create a new ODR on node node with name odr and add it to ODR cluster cluster.
  • insertCustomLogRule <node:odr> <cluster><odrServerOrCluster> <ruleNumber> <condition> <logFileFormat>: Insert a custom log rule into the list at position <ruleNumber>.
  • RemoveCustomLogRule <odrServerOrCluster> <ruleNumber>: Remove the custom log rule number <ruleNumber>.
  • listCustomLogRules <odrServerOrCluster>: List the custom log rules associated with an ODR or ODR cluster.
  • insertCustomLogRule<node:odr> <cluster><odrServerOrCluster> <ruleNumber> <condition> <logFileFormat>: Insert a custom log rule into the list at position <ruleNumber>. If <ruleNumber> is larger than the number of rules in the list, the new rule is appended to the list with the next available rule number.
where:
Table 1. Arguments
Argument Description

<node:odr>

Name of the node and ODR. For example, mynode:myodr.

<cluster>

Name of an ODR cluster.

<odrServerOrCluster>

Is either <node:odr> or <cluster>

<ruleNumber>

Number of the rule, from 1 to the total number of rules (or larger for insertCustomLogRule).

<condition>

Condition (that is, boolean expression) which must evaluate to true in order to trigger the associated custom logging.

<logFileFormat>

Specification denoting the file name and format of the log entry. For more information, read about custom log file format.

The following example shows how to create an HTTP ODR named odr, on node 1:

wsadmin.sh -f createodr.jacl node1 odr odr

The following example shows how to convert an ODR named odr on node node1 to an ODR cluster named ODRCluster:

wsadmin.sh -f manageODR.py -lang jython convertToCluster node1:odr ODRCluster

The following example shows how to add a custom log rule to put all requests whose service time is longer than 2 seconds in the slow.log custom log, and include the application server to which the request was sent and the service time:

wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule myNode02:odr1 1 "service.time > 2000" "slow.log %t %r %Z %T"

The following example shows how to add a custom log rule to put all 503 responses in 503.log. The rule is added at position 2. If there is an existing rule at position 2, the new rule is inserted before the existing rule.

wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule myNode02:odr1 2 "response.code = 503" "503.log %t %r %s

The following example shows how to add a custom log rule at position 1 to log errors that can occur when writing a response to a client in the response.write.error.log:

wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule node1:odr 1 "response.write.error" "response.write.error.log %t %r %s"
Reference topic    

Terms and conditions for information centers | Feedback

Last updated: March 19, 2013 10:03 PM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd-mp&topic=rwve_odoemanage
File name: rwve_odoemanage.html