Oracle® Solaris Cluster Geographic Edition System Administration Guide

Exit Print View

Updated: July 2014, E39667-01

Creating an Action Shell Script for Heartbeat-Loss

You can create an action shell script that runs when the local cluster detects a heartbeat-loss in the partner cluster. The script runs with root permissions. The file must have root ownership and execution permissions, but the script should not have write permissions.

If you have configured the Notification_actioncmd property, the action command runs with arguments that provide information about the event in the following command line:

# custom-action-command-path -c local-cluster-name -r remote-partner-cluster-name -e 1 \
-n nodename -t time

Specifies a path to the action command you have created.

–c local-cluster-name

Specifies the name of the local cluster.

–p remote-partner-cluster-name

Specifies the name of the remote partner cluster.


Specifies that HBLOST=1, which indicates that a heartbeat-loss event has occurred. The Geographic Edition software only supports heartbeat-loss notification, so –e 1 is the only value that can be passed to the action shell script.


Specifies the name of the cluster node that sent the heartbeat-loss event notification.

–t timestamp

Specifies the time of the heartbeat-loss event as the number of milliseconds since January 1, 1970, 00:00:00 GMT.


Caution  -  You can use this script to perform an automatic takeover on the secondary cluster. However, such an automated action is risky. If the heartbeat-loss notification is caused by a total loss of all heartbeat connectivity on both the primary and secondary clusters, such an automated action could lead to a situation where two primary clusters exist.

Example 6-11  How a Notification Action Script Parses the Command-Line Information Provided by the Geographic Edition Software

This example displays the event information that is provided in the command-line being parsed in a notification action shell script.


set -- `getopt abo: $*`
if [ $? != 0]
echo $USAGE
exit 2

for i in $*

case $i in
-p)      PARTNER_CLUSTER=$1; shift;;
-e)      HB_EVENT=$2; shift;;
-c)      LOCAL_CLUSTER=$3; shift;;
-n)      EVENT_NODE=$4; shift;;