HP Serviceguard Enterprise Cluster Master Toolkit User Guide, December 2012 (5900-2145)

The service name must be the same as defined in the package configuration file. Always call
the Oracle executable script with start for the SERVICE_CMD definitions.
SERVICE_NAME[0]=ORACLE_${SID_NAME}
SERVICE_CMD[0]="/etc/cmcluster/pkg/${SID_NAME}/tookit.sh monitor"
SERVICE_RESTART[0]="-r 2"
For example:
SERVICE_NAME[0]=ORACLE_TEST0
SERVICE_CMD[0]="/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh monitor"
SERVICE_RESTART[0]="-r 2"
If you must monitor a Listener, add another service for the listener, as follows:
SERVICE_NAME[1]=LSNR_0
SERVICE_CMD[1]="/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh monitor_listener"
SERVICE_RESTART[1]="-r 2"
To monitor the hang condition of a data base, add another service, as follows:
SERVICE_NAME[2]=DB_HANG_0
SERVICE_CMD[2]="/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh hang_monitor 30 failover"
SERVICE_RESTART[2]="-r 2"
You can set the service reset counter to zero for this service by using the Serviceguard command
cmmodpkg. The service restart counter is incremented each time the service fails. It can
determine when a package has exceeded its restart limit as defined by the SERVICE_RESTART
parameter in the package control script.
To reset the restart counter run the following command:
cmmodpkg [-v] [-n node_name] -R -s service_name package_name
NOTE: If listener monitoring is not required, do not configure a new service for listener.
Edit the customer_defined_run_cmds function to run the toolkit.sh script with the start option.
In the following example, the line /etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh
start is added, and the ":" null command line deleted.
For example:
function customer_defined_run_cmds
{
# Start the Oracle database.
/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh start
test_return 51
}
Edit the customer_defined_halt_cmds function as described in the following example, to include
the check to get the reason for package halt, that is, whether the package halt is due to a
failure of a service or a user initiated shutdown. Also, run the toolkit.sh script with the stop
option.
For example:
function customer_defined_halt_cmds
{
# Stops the database with a "shutdown abort" or a
# "shutdown immediate" command.
if [ $SG_HALT_REASON = "user_halt" ]; then
reason="user"
24 Using the Oracle Toolkit in an HP Serviceguard Cluster