Managing HP Serviceguard for Linux, Tenth Edition, September 2012

Figure 30 depicts a multi-node package containing two monitoring scripts configured
— one to monitor a lan and other to monitor a CPU. The two packages are configured
with the generic resource names and are dependent on the multi-node package.
Figure 30 Multi-node package configured with all the monitoring scripts for generic
resources of type before_package_start
Template of a Monitoring Script
Monitoring Script Template
/etc/cmcluster/examples/generic_resource_monitor.template
# **********************************************************************
# * *
# * This script is a template that can be used as a service when *
# * creating a customer defined sample monitor script for *
# * generic resource(s). *
# * *
# * Once created, this script can be configured into the package *
# * configuration file as a service with the "service_name", *
# * "service_cmd" and "service_halt_timeout" parameters. *
# * Note that the respective "sg/service" and the *
# * "sg/generic_resource" modules need to be specified in the package *
# * configuraton file in order to configure these parameters. *
# * *
# * *
# * --------------------------------- *
# * U T I L I T Y F U N C T I O N S *
# * --------------------------------- *
# * The following utility functions are sourced in from $SG_UTILS *
# * ($SGCONF/scripts/mscripts/utils.sh) and available for use: *
# * *
# * sg_log <log level> <log msg> *
# * *
# * By default, only log messages with a log level of 0 will *
# * be output to the log file. If parameter "log_level" is *
Template of a Monitoring Script 343