Managing HP Serviceguard A.11.20.20 for Linux, May 2013

For resources of evaluation_type: before_package_start
Monitoring scripts can also be launched outside of the Serviceguard environment, init, rc
scripts, etc. (Serviceguard does not monitor them).
The monitoring scripts for all the resources in a cluster of type before_package_start
can be configured in a single multi-node package by using the services functionality and any
packages that require the resources can mention the generic resource name in their package
configuration file.
This makes the scripts highly available, since Serviceguard monitors them and is the
recommended approach. The monitoring script has to be configured to run on all the nodes
the package is configured to run on. See the recommendation and an example below.
For explanation of generic resource parameters, see under “Package Parameter Explanations
(page 174).
HP recommends you to:
Create a single multi-node package and configure all the monitoring scripts for generic
resources of type before_package_start in this multi-node package using the services
functionality.
Mention the generic resource name in the application package and configure the generic
resource as before_package_start.
Configure a dependency for better readability, where the application package is dependent
on this multi-node package.
For example:
package_name generic_resource_monitors
package_type multi_node
service_name lan1_monitor
service_cmd $SGCONF/generic_resource_monitors/lan1.sh
service_name cpu_monitor
service_cmd $SGCONF/generic_resource_monitors/cpu_monitor.sh
The above example shows a sample multi-node package named generic_resource_monitors
and has two monitoring scripts configured one each to monitor a LAN and CPU. These monitoring
scripts will monitor the LAN interface, CPU and sets the status of the generic resources defined in
them accordingly.
Consider a package pkg1 having the LAN resource configured as before_package_start
and the monitoring script for this is running in the multi-node package
generic_resource_monitors. A dependency is created such that the multi-node package
must be UP in order to start the package pkg1. Once the multi-node package is started, the
monitoring of resource 'lan1' is started as part of the monitoring script 'lan1.sh'. The script will set
the status of the generic resource 'lan1' and once the is UP, the package pkg1 is eligible to be
started.
package_name pkg1
package_type failover
generic_resource_name lan1
generic_resource_evaluation_type before_package_start
dependency_name generic_resource_monitors
dependency_condition generic_resource_monitors = up
dependency_location same_node
Similarly, consider another package pkg2 that requires the 'CPU' to be configured as
before_package_start.
package_name pkg2
package_type failover
generic_resource_name cpu
298 Monitoring Script for Generic Resources