Intelligent Management: health policy administrative tasks
Use the following administrative tasks to create, delete, and manage health policies.
createHealthPolicy command
Create a new health policy.
Argument Description name (required) Name for the health policy that is unique in the cell. description 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) 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 we must specify. expression If we are using a custom condition, then specify a subexpression to evaluate. params
- AGE
- maxAge: Specifies maximum age.
- ageUnits: Type of units for the age parameter. The value can be HOURS or MINUTES. The default is HOURS.
- WORKLOAD
- totalRequests: Total requests to service before restarting the members. The number must be greater than or equal to 1000.
- MEMORY_LEAK
- level: Detection level for the memory leak. The value can beFAST, NORMAL, or CONSERVATIVE. The default is FAST.
- EXCESSIVE_MEMORY
- timeOverThreshold: Offending time period for the excessive memory condition. The default is 1 MINUTE.
- timeUnits: Units for the timeOverThreshold value. The value can be MINUTES or SECONDS. The default is MINUTES.
- memoryUsed: Percentage that represents the maximum Java virtual machine (JVM) heap size to use for the JVM process. The value ranges from 1 to 99.
- EXCESSIVE_RESPONSE_TIME
- responseTime: Average response time that is considered to be excessive. When the average reaches this value, members restart.
- responseTimeUnits: Time units for the response time. The value can be MINUTES, SECONDS, or MILLISECONDS.
- EXCESSIVE_REQUEST_TIMEOUT
- timeoutPercent: Threshold value for the percentage of the timed out requests to cause a breach of condition. This value ranges from 1 to 99.
- STORM_DRAIN
- level: Detection level. The value can be NORMAL or CONSERVATIVE. NORMAL is less accurate, but can detect a storm drain condition quickly. CONSERVATIVE is the most accurate, but takes a longer time to detect a storm drain condition.
- GC_PERCENTAGE
- garbageCollectionPercent: The threshold value for the percentage of time spent in garbage collection. This value can be between 1 and 99. The default is 10.
- samplingPeriod: Sampling period for gathering garbage collection data. The total amount of time spent in garbage collection during the sampling time period must be higher than the threshold value prior to a corrective action. This value can go from 1 minute to 24 hours. The default is 2 minutes.
- samplingUnits: Time units for the samplingPeriod parameter. The value can be MINUTES or HOURS. The default is MINUTES.
- The garbageCollectionPercent and samplingPeriod parameters are required and must be specified in order to execute the command.
Argument Description type (required) Action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. stepNum (required) Order in which to take the actions. Step 1 is completed first, and so on. action Name of a custom action. Use the createHealthAction command to create a custom action. Only required for custom actions. node Node on which to take the action. Only required for custom actions. Valid options are a node name or the empty string "".
server Server on which to take the action. Required only for custom actions. Valid options are a server name or one of the following strings: "Sick server" or "Node agent of the sick server". If either of these strings are used, the valid node value is the empty string, "".
Argument Description type (required) Type of member. The value can be CELL, CLUSTER, DYNAMIC_CLUSTER, SERVER, or ODR. name (required) Name of the member. node Name of the node. The node name is required if we select the SERVER type. createHealthPolicy command examples
Interactive mode example usage:
- Use Jacl:
$AdminTask createHealthPolicy {-interactive}
- Use Jython:
AdminTask.createHealthPolicy ('[-interactive]')
Batch mode example usage:
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 our custom condition in quotes.
modifyHealthPolicy command
Change an existing health policy.
Argument Description name (required) Name of the health policy 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 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 we must specify. expression If we are using a custom condition, then specify a subexpression to evaluate. params
- AGE
- maxAge: Specifies maximum age.
- ageUnits: Type of units for the age parameter. The value can be HOURS or MINUTES. The default is HOURS.
- WORKLOAD
- totalRequests: Total requests to service before restarting the members. The number must be greater than or equal to 1000.
- MEMORY_LEAK
- level: Detection level for the memory leak. The value can beFAST, NORMAL, or CONSERVATIVE. The default is FAST.
- EXCESSIVE_MEMORY
- timeOverThreshold: Offending time period for the excessive memory condition. The default is 1 MINUTE.
- timeUnits: Units for the timeOverThreshold value. The value can be MINUTES or SECONDS. The default is MINUTES.
- memoryUsed: Percentage that represents the maximum Java virtual machine (JVM) heap size to use for the JVM process. The value ranges from 1 to 99.
- EXCESSIVE_RESPONSE_TIME
- responseTime: Average response time that is considered to be excessive. When the average reaches this value, members restart.
- responseTimeUnits: Time units for the response time. The value can be MINUTES, SECONDS, or MILLISECONDS.
- EXCESSIVE_REQUEST_TIMEOUT
- timeoutPercent: Threshold value for the percentage of the timed out requests to cause a breach of condition. This value ranges from 1 to 99.
- STORM_DRAIN
- level: Detection level. The value can be NORMAL or CONSERVATIVE. NORMAL is less accurate, but can detect a storm drain condition quickly. CONSERVATIVE is the most accurate, but takes a longer time to detect a storm drain condition.
- GC_PERCENTAGE
- garbageCollectionPercent: The threshold value for the percentage of time spent in garbage collection. This value can be between 1 and 99. The default is 10.
- samplingPeriod: Sampling period for gathering garbage collection data. The total amount of time spent in garbage collection during the sampling time period must be higher than the threshold value prior to a corrective action. This value can go from 1 minute to 24 hours. The default is 2 minutes.
- samplingUnits: Time units for the samplingPeriod parameter. The value can be MINUTES or HOURS. The default is MINUTES.
- The garbageCollectionPercent and samplingPeriod parameters are required and must be specified in order to execute the command.
Argument Description name Name of the health action to remove. The name parameter is only used for custom actions. type (required) 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) Action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. action Name of the health action. Use the createHealthAction command to create a custom action. Only required for custom actions. node Node on which to take the action. Only required for custom actions. Valid options are a node name or the empty string "". server Server on which to take the action. Required only for custom actions. Valid options are a server name or one of the following strings: "Sick server" or "Node agent of the sick server". If either of these strings are used, the valid node value is the empty string, "".
stepNum (required) Order in which to take the actions. Step 1 is completed first, and so on.
Argument Description name Name of the health action. The name parameter is only used for custom actions. type Action type. The value can be CUSTOM, HEAPDUMP, THREADDUMP, RESTART_SERVER, SET_MAINT_MODE, MAINT_MODE_BREAK, or MAINT_MODE_STOP. stepNum (required) Order in which to take the actions. Step 1 is completed first, and so on.
Argument Description type (required) Type of member. The value can be CELL, CLUSTER, DYNAMIC_CLUSTER, SERVER, or ODR. name (required) Name of the member. node Name of the node. The node name is required if we select the SERVER type. modifyHealthPolicy command examples
Interactive mode example usage:
- Use Jacl:
$AdminTask modifyHealthPolicy {-interactive}
- Use Jython:
AdminTask.modifyHealthPolicy ('[-interactive]')
Batch mode example usage:
$AdminTask modifyHealthPolicy { -name myHealthPolicy -removeAction { -type HEAPDUMP } }
deleteHealthPolicy command
Remove the named health policy.
Argument Description name (required) Health policy name to delete. deleteHealthPolicy command examples
Batch mode example usage:
- Use Jacl:
$AdminTask deleteHealthPolicy {-name MyHealthPolicy}
- Use Jython:
AdminTask.deleteHealthPolicy('MyHealthPolicy')
Interactive mode example usage:
- Use Jacl:
$AdminTask deleteHealthPolicy {-interactive}
- Use Jython:
AdminTask.deleteHealthPolicy ('[-interactive]')
listHealthPolicies command
List each configured health policy in the cell.listHealthPolicies command examples
- Use Jacl:
$AdminTask listHealthPolicies
- Use Jython:
AdminTask.listHealthPolicies
createHealthAction command
Create a new health action we can use when defining our health policies.
Create a Java action or an action that is any other type of executable file.
Argument Description name (required) Name for the health action.
Argument Description executable Executable file path. This argument is required if we specify a nonJava step argument. executableArgs Specifies a string array of arguments to pass to the executable file. osNames 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 Location in the file system from where the command is invoked. This argument is required if we specify a nonJava step argument. usernameVar Specifies a variable for the user name. userNameVal Value of the user name variable. passwordVar Specifies a variable for the password. passwordVal Value of the password variable.
Argument Description javaDir Location of our Java executable file, for example, ${JAVA_HOME}. We can specify a variable or a path. executableTargetType File type that we are using for our Java executable file. The value can be EXECUTABLE_JAR or JAVA_CLASS. executable Executable file path. This argument is required if we specify a Java step argument. exectuableArgs Specifies a string array of arguments to pass to the executable file. osNames 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 Java process id variable name. workingDir Location in the file system from where the command is invoked. This argument is required if we specify a Java step argument. usernameVar Specifies a variable for the user name. usernameVal Value of the user name variable. passwordVar Specifies a variable for the password. passwordVal Value of the password variable. createHealthAction command examples
Batch mode example usage:
- Use 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 } }
Interactive mode example usage:
- Use Jacl:
$AdminTask createHealthAction {-interactive}
- Use Jython
AdminTask.createHealthAction('[-interactive]')
modifyHealthAction command
Use the modifyHealthAction command to modify an existing health action.
Argument Description name (required) Name for the health action to modify.
Argument Description executable Executable file path. executableArgs Specifies a string array of arguments to pass to the executable file. workingDir Location in the file system from where the command is invoked. usernameVar Specifies a variable for the user name. usernameVal Value of the user name variable. passwordVar Specifies a variable for the password. passwordVal Value of the password variable.
Argument Description javaDir Location of our Java executable file, for example, ${JAVA_HOME}. We can specify a variable or a path. executableTargetType File type that we are using for our Java executable file. The value can be EXECUTABLE_JAR or JAVA_CLASS. executable Executable file path. executableArgs Specifies a string array of arguments to pass to the executable file. pidVarName Java process id variable name. usernameVar Specifies a variable for the user name. usernameVal Value of the user name variable. passwordVar Specifies a variable for the password. passwordVal Value of the password variable. workingDir Location in the file system from where the command is invoked. modifyHealthAction command examples
Batch mode example usage:
$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:
- Use Jacl:
$AdminTask modifyHealthAction {-interactive}
- Use Jython
AdminTask.modifyHealthAction('[-interactive]')
deleteHealthAction command
Remove a health action.
Argument Description name (required) Name for the health action. deleteHealthAction command examples
Batch mode example usage:
- Use Jacl:
$Admintask deleteHealthAction {-name myHealthAction}
- Use Jython:
AdminTask.deleteHealthAction('-name myHealthAction')
listHealthActions command
List each of the defined health actions in the cell.
listHealthActions command examples
Batch mode example usage:
- Use Jacl:
$Admintask listHealthActions
- Use Jython:
AdminTask.listHealthActions
executeHealthAction command
Run the specified health action.
Argument Description name (required) Name of the health action to run. node (required) Node on which to take the action. Only required for custom actions. Valid options are a node name or the empty string "". server (required) Server on which to take the action. cell Cell on which to run the health action. timeout Timeout value for running the health action. variables Specifies java.util.Properties values of variables. executeHealthAction command examples
Batch mode example usage:
- Use Jacl:
$AdminTask executeHealthAction {-name myHealthAction -node myNode -server myServer}
- Use Jython:
AdminTask.executeHealthAction ('[-name myHealthAction -node myNode -server myServer]')
Interactive mode example usage:
- Use Jacl:
$AdminTask executeHealthAction {-interactive}
- Use Jython:
AdminTask.executeHealthAction ('[-interactive]')
Related:
Health management Configure health management Create health policies Create health policy custom actions Set maintenance mode Intelligent Management: maintenance mode administrative tasks