Create health policy custom actions
Use custom actions to define custom corrective tasks that you can use when a health condition breaches.
Before you begin
Create a Java or non-Java executable file to run when the health condition breaches. You can use environment variables in your executable file to display the cell, node, and server that is affected by the health action, for example:
#!/bin/sh echo "The sick server is " echo $server echo " which is on node " echo $node echo " which is a part of cell " echo $cell
About this task
By default, you can define the following actions to occur when a health condition breaches:
- restart the server
- take thread dumps
- take heap dumps
If you have more specific needs for actions that occur when a health condition breaches, then create a custom action. Custom actions consist of Java or non-Java process definitions, and can run...
- On the deployment manager
- A node that is hosting servers that breach health conditions
- The node where the health management controller is running
- A node that you specify
Create a custom action before you create a health policy. When you define the health policy, select the custom action as part of the action plan that runs when the health condition breaches. You can also define a custom action when you are creating an action plan in the health policy creation wizard.
Procedure
- Select a Java or non-Java action type. In the administrative console, click...
Operational policies | Custom action | New
Choose the type of action to create.
For health actions that run non-Java and Java executable files...
For health actions that run Java executable files, also specify the following properties...
For example, if you had an executable file to collect logs called logCollector.sh, you might fill in the following values for the custom action:
Name | LogCollect |
Executable | /opt/mws/bin/logCollector.sh |
Executable arguments: | None |
Operating system | UNIX |
Work directory | /opt/mws/bin/ |
Servers | All servers | middleware_server | Variables | New
...or...
Environment | WebSphere Variables | New
Enter the same name for the variable that you entered in the health action panel, and for the value, enter the fully qualified or variable qualified location of the PID file.
Create a health policy. In the administrative console, click...
Operational policies | Health policies | New