Managing Serviceguard A.11.20, March 2013

The following is an example of how to configure simple and extended resources.
Simple generic resource:
generic_resource_name sfm_disk
generic_resource_evaluation_type before_package_start
Extended generic resource:
generic_resource_name cpu_lan
generic_resource_evaluation_type during_package_start
generic_resource_up_criteria <50
For more information on the generic resource parameters, see “Package Parameter Explanations
(page 237).
Configuring a Generic Resource
This section describes the step-by-step procedure to configure generic resources. You can also
configure generic resources from the Serviceguard Manager. See the online help for instructions
on how to configure from Serviceguard Manager.
1. Create a package configuration file that contains the generic resource module:
cmmakepkg $SGCONF/pkg1/pkg1.conf
Package template is created.
This file must be edited before it can be used.
NOTE: To generate a configuration file adding the generic resource module to an existing
package (enter the command all on one line):
cmmakepkg -i $SGCONF/pkg1/pkg1.conf -m sg/generic_resource
2. Edit the package configuration file and specify the generic resource parameters (as shown in
the snippet):
service_name sfm_disk_monitor
service_cmd /etc/cmcluster/pkg1/sample_generic_resource_disk_monitor.sh
service_halt_timeout 10
generic_resource_name sfm_disk
generic_resource_evaluation_type during_package_start
NOTE: Generic resources must be configured to use the monitoring script. It is the monitoring
script that contains the logic to monitor the resource and set the status of a generic resource
accordingly by using cmsetresource(1m).
These scripts must be written by the end-users according to their requirements. The monitoring
script must be configured as a service in the package if the monitoring of the resource is
required to be started and stopped as a part of the package.
This can be achieved by configuring a service_name and a service_cmd, by providing
the full path name of the monitoring script as the service_cmd value as shown above. The
service_name and generic_resource_name need not be the same. However, it would
be a good practice to do it, so that it would be easier to identify the monitor.
HP provides a template and sample scripts as an example of how a monitoring script can be
written. For more information on monitoring scripts and a template, see “Monitoring Script
for Generic Resources” (page 396) and “Template of a Monitoring Script” (page 398).
If the generic_resource_up_criteria is specified, the given resource is considered to
be an extended generic resource, else it is a simple generic resource. For the description of
generic resources parameters, see “Package Parameter Explanations (page 237). See “Using
the Generic Resources Monitoring Service” (page 58).
3. After editing the package configuration file, verify the content of the package configuration
file:
cmcheckconf -v -P $SGCONF/pkg1/pkg1.conf
Package Configuration Planning 139