Configuring a custom application monitor

You can configure multiple application monitors and associate them with one or more application controllers. By supporting multiple monitors per application, PowerHA® SystemMirror® can support more complex configurations.

Custom application monitoring allows you to write a monitor method to test for conditions other than process termination. For example, if an application sometimes becomes unresponsive while still running, a custom monitor method could test the application at defined intervals and report when the application's response is too slow. Also, some applications (shell scripts, for example) cannot be registered with RSCT, so process monitoring cannot be configured for them. A custom application monitor method can monitor these types of applications.

For instructions on defining a process application monitor, which requires no custom monitor method, refer to Application monitoring prerequisites and considerations.

Defining a monitor method

Unlike process monitoring, custom application monitoring requires you to provide a script to test the health of the application. You must also decide on a suitable polling interval.

When devising your custom monitor method, keep the following points in mind:

  • The monitor method must be an executable program (it can be a shell script) that tests the application and exits, returning an integer value that indicates the application's status. The return value must be zero if the application is healthy, and must be a non zero value if the application has failed.
  • The method can log messages by printing them to the standard output stdout file. For long running monitors, the output is stored in the /var/hacmp/log/clappmond.application monitor name.resource group name.monitor.log file. For startup monitors, this output is stored in the /var/hacmp/log/clappmond.application controller name.resource group name.monitor.log file. In PowerHA SystemMirror Version 7.1.1, or earlier, there is a single log file that is overwritten each time the application monitor is restarted. In PowerHA SystemMirror Version 7.1.2, or later, a new log file is created each time the application monitor is restarted.
  • Since the monitor method is set up to terminate if it does not return within the specified polling interval, do not make the method overly complicated.