Intelligent Management: health policy administrative tasks
You can use the following administrative tasks to create, delete, and manage health policies.
createHealthPolicy command
The createHealthPolicy command creates a new health policy.Argument | Description |
---|---|
name (required) | Specifies a name for the health policy that is unique in the cell. |
description | Specifies a description for the health policy. |
reactionMode | Specifies if runtime tasks are created before taking actions on a health policy, or if actions are automatic. The value can be SUPERVISE or AUTOMATIC. |
Argument | Description |
---|---|
type (required) | Specifies the condition type. The value can be CUSTOM, AGE, WORKLOAD, MEMORY_LEAK, EXCESSIVE_MEMORY, EXCESSIVE_RESPONSE_TIME, EXCESSIVE_REQUEST_TIMEOUT, STORM_DRAIN or GC_PERCENTAGE. Each value has different parameters that you must specify. |
expression | If you are using a custom condition, then specify a subexpression to evaluate. |
params |
|
Argument | Description |
---|---|
type (required) | Specifies the action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. |
stepNum (required) | Specifies the order in which to take the actions. Step 1 is completed first, and so on. |
action | Specifies the name of a custom action. Use the createHealthAction command to create a custom action. This parameter is only required for custom actions. |
node | Specifies the node on which to take the action. This parameter is only required for custom actions. Valid options are a node name or the empty string "". |
server | Specifies the server on which to take the
action. This parameter is required only for custom actions. Valid options are a server name
or one of the following strings: |
Argument | Description |
---|---|
type (required) | Specifies the type of member. The value can be CELL, CLUSTER, DYNAMIC_CLUSTER, SERVER, or ODR. |
name (required) | Specifies the name of the member. |
node | Specifies the name of the node. The node name is required if you select the SERVER type. |
createHealthPolicy command examples
Interactive mode example usage:
- Using Jacl:
$AdminTask createHealthPolicy {-interactive}
- Using Jython:
AdminTask.createHealthPolicy ('[-interactive]')
Batch mode example usage in Jacl:
The following command creates a health policy with one of the predefined health conditions:
$AdminTask createHealthPolicy { -name myHealthPolicy -description "My Health Policy" -reactionMode SUPERVISE
-addCondition { -type AGE -params {{maxAge 12} {ageUnits HOURS}} } -addAction {{HEAPDUMP 1}{CUSTOM 2 myAction
myNode myServer} } -addMember {{SERVER myServer1 myNode1}{SERVER myServer2 mynode2}}
The following command creates a health policy with a custom condition:
$AdminTask createHealthPolicy { -name myHealthPolicy -description "My Health Policy" -reactionMode SUPERVISE
-addCondition { -type CUSTOM -expression "ODRServerMetric_FromServerStart$errors > 100L" }
-addAction {{HEAPDUMP 1}{CUSTOM 2 myAction myNode myServer} } -addMember {{SERVER myServer1 myNode1}{SERVER myServer2 mynode2}}
Put
the expression for your custom condition in quotes.Batch mode example usage in Jython:
The following command creates a health policy with one of the predefined health conditions:
AdminTask.createHealthPolicy('[ -name myHealthPolicy -description "My Health Policy" -reactionMode SUPERVISE -addCondition [ -type AGE -params [[maxAge 12] [ageUnits HOURS]] ] -addAction [[HEAPDUMP 1][CUSTOM 2 myAction myNode1 myServer1] ] -addMember [[SERVER myServer1 myNode1][SERVER myServer2 mynode2]]')
The following command creates a health policy with a custom condition:
AdminTask.createHealthPolicy('[ -name myHealthPolicy -description "My Health Policy" -reactionMode SUPERVISE -addCondition [ -type CUSTOM -expression "ODRServerMetric_FromServerStart$errors > 100L" ] -addAction [[HEAPDUMP 1][CUSTOM 2 myAction myNode1 myServer1] ] -addMember [[SERVER myServer1 myNode1]]')
modifyHealthPolicy command
The modifyHealthPolicy command changes an existing health policy.Argument | Description |
---|---|
name (required) | Specifies the name of the health policy that you want to change. |
reactionMode | Specifies if runtime tasks are created before taking actions on a health policy, or if actions are automatic. The value can be SUPERVISE or AUTOMATIC. |
Argument | Description |
---|---|
type | Specifies the condition type. The value can be CUSTOM, AGE, WORKLOAD, MEMORY_LEAK, EXCESSIVE_MEMORY, EXCESSIVE_RESPONSE_TIME, EXCESSIVE_REQUEST_TIMEOUT, STORM_DRAIN or GC_PERCENTAGE. Each value has different parameters that you must specify. |
expression | If you are using a custom condition, then specify a subexpression to evaluate. |
params |
|
Argument | Description |
---|---|
name | Specifies the name of the health action to remove. The name parameter is only used for custom actions. |
type (required) | Specifies the action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. |
Argument | Description |
---|---|
type (required) | Specifies the action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. |
action | Specifies the name of the health action. Use the createHealthAction command to create a custom action. This parameter is only required for custom actions. |
node | Specifies the node on which to take the action. This parameter is only required for custom actions. Valid options are a node name or the empty string "". |
server | Specifies the server on which to take the
action. This parameter is required
only for custom actions. Valid options are a server name or one of the following strings: |
stepNum (required) | Specifies the order in which to take the actions. Step 1 is completed first, and so on. |
Argument | Description |
---|---|
name | Specifies the name of the health action. The name parameter is only used for custom actions. |
type | Specifies the action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. |
stepNum (required) | Specifies the order in which to take the actions. Step 1 is completed first, and so on. |
Argument | Description |
---|---|
type (required) | Specifies the type of member. The value can be CELL, CLUSTER, DYNAMIC_CLUSTER, SERVER, or ODR. |
name (required) | Specifies the name of the member. |
node | Specifies the name of the node. The node name is required if you select the SERVER type. |
modifyHealthPolicy command examples
Interactive mode example usage:
- Using Jacl:
$AdminTask modifyHealthPolicy {-interactive}
- Using Jython:
AdminTask.modifyHealthPolicy ('[-interactive]')
Batch mode example usage in Jacl:
$AdminTask modifyHealthPolicy { -name myHealthPolicy -removeAction { -type HEAPDUMP } }
Batch mode example usage in Jython:
AdminTask.modifyHealthPolicy('[ -name myHealthPolicy -removeAction [ -type HEAPDUMP ] ]')
deleteHealthPolicy command
The deleteHealthPolicy command removes the named health policy.Argument | Description |
---|---|
name (required) | Specifies the health policy name to delete. |
deleteHealthPolicy command examples
Batch mode example usage:
- Using Jacl:
$AdminTask deleteHealthPolicy {-name MyHealthPolicy}
- Using Jython:
AdminTask.deleteHealthPolicy('MyHealthPolicy')
Interactive mode example usage:
- Using Jacl:
$AdminTask deleteHealthPolicy {-interactive}
- Using Jython:
AdminTask.deleteHealthPolicy ('[-interactive]')
listHealthPolicies command
The listHealthPolicies command lists each configured health policy in the cell.listHealthPolicies command examples
- Using Jacl:
$AdminTask listHealthPolicies
- Using Jython:
AdminTask.listHealthPolicies()
createHealthAction command
The createHealthAction command creates a new health action that you can use when you define your health policies.Argument | Description |
---|---|
name (required) | Specifies a name for the health action. |
Argument | Description |
---|---|
executable | Specifies the executable file path. This argument is required if you specify a nonJava step argument. |
executableArgs | Specifies a string array of arguments to pass to the executable file. |
osNames | Specifies a comma-delimited list of operating systems. Specify null to have the action apply for each operating system. The valid operating system names include: windows, unix, and zos. |
workingDir | Specifies the location in the file system from where the command is invoked. This argument is required if you specify a nonJava step argument. |
usernameVar | Specifies a variable for the user name. |
userNameVal | Specifies the value of the user name variable. |
passwordVar | Specifies a variable for the password. |
passwordVal | Specifies the value of the password variable. |
Argument | Description |
---|---|
javaDir | Specifies the location of your Java executable file, for example, ${JAVA_HOME}. You can specify a variable or a path. |
executableTargetType | Specifies the file type that you are using for your Java executable file. The value can be EXECUTABLE_JAR or JAVA_CLASS. |
executable | Specifies the executable file path. This argument is required if you specify a Java step argument. |
exectuableArgs | Specifies a string array of arguments to pass to the executable file. |
osNames | Specifies a comma-delimited list of operating systems. Specify null to have the action apply for each operating system. The valid operating system names include: windows, unix, and zos. |
pidVarName | Specifies the Java process id variable name. |
workingDir | Specifies the location in the file system from where the command is invoked. This argument is required if you specify a Java step argument. |
usernameVar | Specifies a variable for the user name. |
usernameVal | Specifies the value of the user name variable. |
passwordVar | Specifies a variable for the password. |
passwordVal | Specifies the value of the password variable. |
createHealthAction command examples
Batch mode example usage:
- Using Jacl:
$AdminTask createHealthAction { -name myAction -java { -javaDir c:\java\bin -executableTargetType EXECUTABLE_JAR -executable test.jar -executableArgs "{arg1}{arg2a arg2b}" -osNames "windows, unix" -pidVarName pvn -workingDir c:\workingDir } }
- Using Jython:
AdminTask.createHealthAction('[ -name myAction -java [ -javaDir c:\java\bin -executableTargetType EXECUTABLE_JAR -executable test.jar -executableArgs "[arg1][arg2a arg2b]" -osNames "windows, unix" -pidVarName pvn -workingDir c:\workingDir ] ]')
Interactive mode example usage:
- Using Jacl:
$AdminTask createHealthAction {-interactive}
- Using Jython:
AdminTask.createHealthAction('[-interactive]')
modifyHealthAction command
Use the modifyHealthAction command to modify an existing health action.Argument | Description |
---|---|
name (required) | Specifies a name for the health action that you want to modify. |
Argument | Description |
---|---|
executable | Specifies the executable file path. |
executableArgs | Specifies a string array of arguments to pass to the executable file. |
workingDir | Specifies the location in the file system from where the command is invoked. |
usernameVar | Specifies a variable for the user name. |
usernameVal | Specifies the value of the user name variable. |
passwordVar | Specifies a variable for the password. |
passwordVal | Specifies the value of the password variable. |
Argument | Description |
---|---|
javaDir | Specifies the location of your Java executable file, for example, ${JAVA_HOME}. You can specify a variable or a path. |
executableTargetType | Specifies the file type that you are using for your Java executable file. The value can be EXECUTABLE_JAR or JAVA_CLASS. |
executable | Specifies the executable file path. |
executableArgs | Specifies a string array of arguments to pass to the executable file. |
pidVarName | Specifies the Java process id variable name. |
usernameVar | Specifies a variable for the user name. |
usernameVal | Specifies the value of the user name variable. |
passwordVar | Specifies a variable for the password. |
passwordVal | Specifies the value of the password variable. |
workingDir | Specifies the location in the file system from where the command is invoked. |
modifyHealthAction command examples
Batch mode example usage:
- Using Jacl:
$AdminTask modifyHealthAction { -name myAction -java { -javaDir c:\java\bin -executableTargetType EXECUTABLE_JAR -executable test.jar -executableArgs "{arg1}{arg2a arg2b}" -pidVarName pvn -workingDir c:\workingDir } }
- Using Jython:
AdminTask.modifyHealthAction('[ -name myAction -java [ -javaDir c:\java\bin -executableTargetType EXECUTABLE_JAR -executable test.jar -executableArgs "[arg1][arg2a arg2b]" -pidVarName pvn -workingDir c:\workingDir ] ]')
Interactive mode example usage:
- Using Jacl:
$AdminTask modifyHealthAction {-interactive}
- Using Jython:
AdminTask.modifyHealthAction('[-interactive]')
deleteHealthAction command
The deleteHealthAction command removes a health action.Argument | Description |
---|---|
name (required) | Specifies a name for the health action. |
deleteHealthAction command examples
Batch mode example usage:
- Using Jacl:
$Admintask deleteHealthAction {-name myHealthAction}
- Using Jython:
AdminTask.deleteHealthAction('-name myHealthAction')
listHealthActions command
The listHealthActions command lists each of the defined health actions in the cell.listHealthActions command examples
Batch mode example usage:
- Using Jacl:
$Admintask listHealthActions
- Using Jython:
AdminTask.listHealthActions()
executeHealthAction command
The executeHealthAction command runs the specified health action.Argument | Description |
---|---|
name (required) | Specifies the name of the health action that you want to run. |
node (required) | Specifies the node on which to take the action. This parameter is only required for custom actions. Valid options are a node name or the empty string "". |
server (required) | Specifies the server on which to take the action. |
cell | Specifies the cell on which to run the health action. |
timeout | Specifies a timeout value for running the health action. |
variables | Specifies java.util.Properties values of variables. |
executeHealthAction command examples
Batch mode example usage:
- Using
Jacl:
$AdminTask executeHealthAction {-name myHealthAction -node myNode -server myServer}
- Using Jython:
AdminTask.executeHealthAction ('[-name myHealthAction -node myNode -server myServer]')
Interactive mode example usage:
- Using Jacl:
$AdminTask executeHealthAction {-interactive}
- Using Jython:
AdminTask.executeHealthAction ('[-interactive]')
Simplified script management
{WAS_HOME}/bin
directory if you are seeking a more
streamlined approach to managing health policies.
./wsadmin.sh -lang jython -f healthpolicy.py
This script provides you with a
guided interface for several health policy operations.Health policy operation examples:
- Age health policy with automated
restart:
./wsadmin.sh -lang jython -f healthpolicy.py createHealthPolicy --hpname Daily --hcond 0 --tt 1 --tunits 4
- Response time health policy with supervised restart:
./wsadmin.sh -lang jython -f healthpolicy.py createHealthPolicy --hpname TenSec --hcond 2 --tt 10 --tunits 0 --hrmode 2
- Memory leak policy with automated heap dumps:
./wsadmin.sh -lang jython -f healthpolicy.py createHealthPolicy --hpname Leaky --hcond 4 --hrs 0,2 -hpd "memory leak policy"
This aims to simplify navigation through health policy configurations, facilitating the implementation and management of policies tailored to system health requirements.