WebSphere Virtual Enterprise, Version 6.1.1
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


healthpolicy.py script

You can use the healthpolicy.py script to create, remove, and add and remove members from health policies.

Purpose

With the healthpolicy.py script, you can:
Deprecated feature: This script was valid for Version 6.0 releases. To configure the newer health policy features, use Health policy administrative tasks .depfeat

Location

The healthpolicy.py script is in the install_root\bin directory.

Usage

To run the healthpolicy.py script, run the following command:
./wsadmin.sh -lang jython -f healthpolicy.py <operation> [options]

Replace the <operation> [options] variables with the appropriate operation and options for your task.

To make changes to health policies, you must have a configurator or an administrator administrative role.

Operations

You can use the following operations with the healthpolicy.py script:
  • createHealthPolicy: Creates a new health policy with no members. You can add members later using the addMember operation.
    Table 1. createHealthPolicy options
    Option Description
    --hpname Specifies a name for the health policy that is unique in the cell.
    --hcond Specifies an integer that represents one of the following health condition types:
    • 0 = age
    • 1 = work
    • 2 = excessive response time
    • 3 = excessive memory
    • 4 = memory leak
    • 5 = stuck request
    • 6 = storm drain
    --hrs
    Specifies an integer that represents the reaction (depends on type). Separate multiple reactions with commas.
    • 0 = restart [default]
    • 1 = thread dump
    • 2 = heap dump
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    --hpd Specifies an optional description of the health policy.
    Table 2. Condition-specific options
    Option Description
    Age condition parameters
    --tt Specifies the maximum age value.
    --tunits
    Specifies an integer that represents one of the following time units:
    • 0 = milliseconds
    • 1 = seconds
    • 2 = minutes
    • 3 = hours
    • 4 = days
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Work condition parameters
    --reqs Specifies a number of requests for the work policy.
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Response time condition parameters
    --tt Specifies the maximum response time.
    --tunits
    Specifies an integer that represents one of the following time units:
    • 0 = milliseconds
    • 1 = seconds
    • 2 = minutes
    • 3 = hours
    • 4 = days
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Memory condition parameters
    --perc Specifies a percentage of heap size for the excessive memory policy.
    --tt Specifies the time over threshold for memory policy.
    --tunits
    Specifies an integer that represents one of the following time units:
    • 0 = milliseconds
    • 1 = seconds
    • 2 = minutes
    • 3 = hours
    • 4 = days
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Memory leak condition parameters
    --level An integer that represents the level of leak detection.
    • 0 = aggressive
    • 1 = normal [default]
    • 2 = conservative
    --hrs Specifies an integer that represents the reaction (depends on type). Separate multiple reactions with commas.
    • 0 = restart [default]
    • 2 = heap dump
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Stuck request condition parameters
    --perc A timeout percentage for stuck request policy.
    --hrs Specifies an integer that represents the reaction (depends on type). Separate multiple reactions with commas.
    • 0 = restart [default]
    • 1 = thread dump
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
    Storm drain condition parameters
    --level An integer that represents the level of storm drain detection
    • 1 = normal [default]
    • 2 = conservative
    --hrmode
    Specifies an integer that represents the reaction mode.
    • 2 = supervised [default]
    • 3 = automatic
  • removeHealthPolicy: Deletes an existing health policy and takes the following option:
    Table 3. removeHealthPolicy options
    Option Description
    --hpname Specifies the unique name for the health policy that you want to remove.
  • addMember: Adds a new member to an existing health policy and takes the following options:
    Table 4. addMember options
    Option Description
    --hpname Specifies a name for the existing health policy that is unique in the cell.
    --mname Specifies a name for the member that you want to create.
    --mtype Specifies one of the following types of members:
    • 1 = application server
    • 2 = cluster
    • 3 = dynamic cluster
    • 4 = cell
  • removeMember: Removes a member from an existing health policy and takes the following options:
    Table 5. removeMember options
    Option Description
    --hpname Specifies a name for the existing health policy that is unique in the cell. This health policy should contain the member that you want to remove.
    --mname Specifies the name of the member that you want to remove.

Example

Use the following examples as a guide for managing your health policies with scripting.

Creating a health policy

Removing a health policy

./wsadmin.sh -lang jython -f healthpolicy.py removeHealthPolicy --hpname Daily

Adding a member to a health policy

./wsadmin.sh -lang jython -f healthpolicy.py addMember --hpname Daily --mtype 3 --mname TestClusterA

Removing a member from a health policy

./wsadmin.sh -lang jython -f healthpolicy.py removeMember --hpname Daily --mname TestClusterA




Related concepts
Health management
Related tasks
Creating health policies
Related reference
Administrative roles and privileges
Health policy administrative tasks
Reference topic    

Terms of Use | Feedback

Last updated: Oct 30, 2009 1:31:01 PM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1m1/index.jsp?topic=/com.ibm.websphere.ops.doc/info/reference/rhealthpolicyscript.html