Implement high-availability solutions with HP Instant Capacity - easily and effectively

36
Scripts for monitoring the health of the Group Manager
The following monitor script should be defined as a service in the package that is running on the cluster. If the script
returns 1, Serviceguard package fails over as the service command has failed. The Group Manager can then be migrated
to the standby Group Manager. The monitor_heartbeat variable is a user tunable variable based on the frequency of the
monitoring desired by the user. By default this is set to five minutes. The tunable_frequency variable is a user tunable
value to set the frequency of icapmanage s checks, it should be set with consideration of the number of members in
the cluster.
#!/usr/bin/sh
is_cimserver_running()
{
monitor_heartbeat = 300
tunable_frequency = 10
sleep $monitor_heartbeat
x=1
while (true)
do {
message=$( ps -e | grep cimserver| grep -v cim serverd | grep -v cimservera
2>&1 )
if [ $? -ne 0 ]
then
{
return 1
}
fi
x=$x+1
if [$x –eq $tunable_frequency ] then
{
/usr/sbin/icapmanage -s | grep '^Active Group Manager' | grep 'cannot be
contacted' > /dev/null
if [ $? -nq 0 ]
then
{
return 1
}
fi
x=1
}
fi
} done
}
Note: These scripts must be combined as needed to achieve best results. A small wrapper can be written around these to check for failure of one or more
partitions and also for checking complete complex outage, and based on the need appropriate scripts could be called. You could also include the health
monitoring in your wrapper script.