Similarly, consider another package pkg2 that requires the 'CPU' to be configured as before_package_start.

package_name package_type

generic_resource_name

generic_resource_evaluation_type

generic_resource_name

generic_resource_evaluation_type

dependency_name dependency_condition dependency_location

pkg2 failover

cpu

before_package_start

lan1

before_package_start

generic_resource_monitors generic_resource_monitors = up same_node

Thus, the monitoring scripts for all the generic resources of type before_package_start are configured in one single multi-node package and any package that requires this generic resource can just configure the generic resource name.

If a common resource has to be monitored in multiple packages, the monitoring scripts can be configured in the multi-node package described above and multiple packages can define the same generic resource name in their package configuration files as seen for the generic resource 'lan1' in the above example.

Figure 49 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 49 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

*

392 Monitoring Script for Generic Resources

Page 392
Image 392
HP Serviceguard manual Template of a Monitoring Script