Hitachi

JP1 Version 12 JP1/Data Highway - Server Configuration and Administration Guide


C.10 Using HA Monitor

Organization of this subsection

(1) Failure detection

To detect server failures by using HA Monitor, you must write some monitoring commands in C language or shell language.

The commands are activated by HA Monitor, and they remain active while the server is up and running. When any of the commands terminates, HA Monitor assumes that a failure has occurred and starts a failover process.

An example monitoring command provided by HA Monitor is shown below. This example command checks for the process of the target program, and if no process exists, then you can assume that a failure occurred on the server.

#!/bin/sh
SERVER=/home/xxxx/yyyy   # Name of the program running on your server
while true                # Main loop
do
    # Use the ps command to check for the process of the program.
    CHECK=`ps -ef | grep $SERVER | grep -v grep`
 
    # If no process is found, exit the command.
    if [ "$CHECK" = "" ]
    then
        exit 0
    fi
 
    # If the process is found, keep monitoring.
done

JP1/DH - Server uses the Linux standard ps command to monitor daemons. It checks the output of the command to determine whether the daemons associated with the JP1/DH - Server system are running.