Steps for configuring a process application monitor

An application must have been defined to an application controller before you set up the monitor.

About this task

To configure a process application monitor (in any of the three running modes: startup mode, long-running mode or both):

Procedure

  1. From the command line, enter smit sysmirror
  2. In SMIT, selectCluster Applications and Resources > Resources > Configure User Applications (Scripts and Monitors) > Application Monitors > Configure Process Application Monitors > Add Process Application Monitor and press Enter. A list of previously defined application controllers appears.
  3. Select the application controller to which you want to add a process monitor.
  4. In the Add a Process Application Monitor panel, fill in the field values as follows:
    Table 1. Add a Process Application Monitor
    Field Value
    Monitor Name Enter the name of the application monitor. Each monitor can have a unique name that does not have to be the same name as the application controller name.
    Monitor Mode Select the mode in which the application monitor monitors the application:
    • startup monitoring. In this mode the application monitor checks that the application controller has successfully started within the specified stabilization interval. The monitor in this mode may run multiple times, as long as it is being run within the stabilization interval that you specify. If the monitor in this mode returns a zero code, this means that the application had started successfully. If a non-zero code is returned, this means that the application did not start within the stabilization interval. Select this mode if you are configuring an application monitor for an application that is included in a parent resource group (in addition to other monitors that you may need for dependent resource groups).
    • long-running monitoring. In this mode, the application monitor periodically checks that the application controller is running. The monitor is run multiple times based on the monitoring interval that you specify. If the monitor returns a zero code, it means that the application is running successfully. A non-zero return code indicates that the application has failed. The checking starts after the specified stabilization interval has passed. This mode is the default.
    • both. In this mode, the application monitor checks that within the stabilization interval the application controller has started successfully, and periodically monitors that the application controller is running after the stabilization interval has passed. If the same monitor is used in the "both" mode, PowerHA® SystemMirror® interprets the return codes differently, according to which type of monitoring is used (see the description of modes).
    Processes to Monitor Specify the process(es) to monitor. You can type more than one process name. Use spaces to separate the names.
    Note: To be sure you are using correct process names, use the names as they appear from the ps -el command (not ps -f), as explained in Identifying correct process names.
    Process Owner Specify the user ID of the owner of the processes specified above, for example root. Note that the process owner must own all processes to be monitored.
    Instance Count Specify how many instances of the application to monitor. The default is 1 instance. The number of instances must exactly match the number of processes to monitor. If you put one instance, and another instance of the application starts, you will receive an application monitor error.
    Note: This number must be more than 1 if you have specified more than one process to monitor (1 instance for each process).
    Stabilization Interval Specify the time (in seconds). PowerHA SystemMirror uses the stabilization period for the monitor in different ways, depending on which monitor mode is selected in this SMIT panel:
    • If you select the startup monitoring mode, the stabilization interval is the period within which PowerHA SystemMirror runs the monitor to check that the application has successfully started. When the specified time expires, PowerHA SystemMirror terminates the monitoring of the application startup and continues event processing. If the application fails to start within the stabilization interval, the resource group's acquisition fails on the node, and PowerHA SystemMirror launches resource group recovery actions to acquire a resource group on another node. The number of seconds you specify should be approximately equal to the period of time it takes for the application to start. This depends on the application you are using.
    • If you select the long-running mode for the monitor, the stabilization interval is the period during which PowerHA SystemMirror waits for the application to stabilize, before beginning to monitor that the application is running successfully. For instance, with a database application, you may wish to delay monitoring until after the start script and initial database search have been completed. You may need to experiment with this value to balance performance with reliability.
    • If you select both as a monitoring mode, the application monitor uses the stabilization interval to wait for the application to start successfully. It uses the same interval to wait until it starts checking periodically that the application is successfully running on the node.
    Note: In most circumstances, this value should not be zero.
    Restart Count Specify the number of times to try restarting the application before taking any other actions. The default is 3 . If you are configuring a monitor that is going to be used only in the startup monitoring mode, restart count does not apply, and PowerHA SystemMirror ignores values entered in this field.
    Note: Make sure you enter a Restart Method if your Restart Count is any non-zero value.
    Restart Interval Specify the interval (in seconds) that the application must remain stable before resetting the restart count. Do not set this to be shorter than (Restart Count) x (Stabilization Interval) . The default is 10% longer than that value. If the restart interval is too short, the restart count will be reset too soon and the desired fallover or notify action may not occur when it should.

    If you are configuring a monitor that is going to be used only in the startup monitoring mode, restart interval does not apply, and PowerHA SystemMirror ignores values entered in this field.

    Action on Application Failure Specify the action to be taken if the application cannot be restarted within the restart count. You can keep the default choice notify, which runs an event to inform the cluster of the failure, or select fallover , in which case PowerHA SystemMirror recovers the resource group containing the failed application on the cluster node with the next highest priority for that resource group.

    If you are configuring a monitor that is going to be used only in the startup monitoring mode, the action specified in this field does not apply, and PowerHA SystemMirror ignores values entered in this field.

    See Application monitoring prerequisites and considerations for more information.

    Notify Method (Optional) Define a notify method that will run when the application fails.

    This custom method runs during the restart process and during notify activity.

    If you are configuring a monitor that is going to be used only in the startup monitoring mode, the method specified in this field does not apply, and PowerHA SystemMirror ignores values entered in this field.

    Cleanup Method (Optional) Specify an application cleanup script to be called when a failed application is detected, before calling the restart method. The default is the application controller stop script defined when the application controller was set up (if you have only one application controller defined. If you have multiple application controllers, enter the stop script in this field that is used for the associated application controller).

    If you are configuring a monitor that is going to be used only in the startup monitoring mode, the method specified in this field does not apply, and PowerHA SystemMirror ignores values entered in this field.

    With application monitoring, since the application is already stopped when this script is called, the server stop script may fail.

    Restart Method (Required if Restart Count is not zero.) The default restart method is the application controller start script defined previously, if only one application controller was set up. This field is empty if multiple servers are defined. You can specify a different method here if desired.

    If you are configuring a monitor that is going to be used only in the startup monitoring mode, the method specified in this field does not apply, and PowerHA SystemMirror ignores values entered in this field.

  5. Press Enter.

    SMIT checks the values for consistency and enters them into the PowerHA SystemMirror Configuration Database. When the resource group is brought online, the application monitor in the long-running mode starts (if it is defined). Note that the application monitor in the startup monitoring mode starts before the resource group is brought online.

    When you synchronize the cluster, verification ensures that all methods you have specified exist and are executable on all nodes.