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 390) and “Template of a Monitoring Script” (page 392).

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 233). See “Using the Generic Resources Monitoring Service” (page 57).

3.After editing the package configuration file, verify the content of the package configuration file:

cmcheckconf -v -P $SGCONF/pkg1/pkg1.conf

cmcheckconf: Verification completed with no errors found. Use the cmapplyconf command to apply the configuration

4.When verification has completed without errors, apply the package configuration file. This adds the package configuration information (along with generic resources) to the binary cluster configuration file in the $SGCONF directory (usually /etc/cmcluster directory) and distributes it to all the cluster nodes.

cmapplyconf -P $SGCONF/pkg1/pkg1.conf

Modify the package configuration ([y]/n)? y Completed the cluster update

5.Verify that the generic resources parameters are configured. cmviewcl -v-p pkg1

UNOWNED_PACKAGES

PACKAGE

STATUS

STATE

AUTO_RUN

NODE

pkg1

down

halted

disabled

unowned

Policy_Parameters:

 

 

 

POLICY_NAME

CONFIGURED_VALUE

 

 

Failover

configured_node

 

 

Failback

manual

 

 

 

Script_Parameters:

 

 

 

ITEM

STATUS

NODE_NAME

NAME

Generic Resource

unknown

node1

sfm_disk

Generic Resource

unknown

node2

sfm_disk

Node_Switching_Parameters:

 

 

NODE_TYPE

STATUS

SWITCHING

NAME

Primary

up

enabled

node1

Alternate

up

enabled

node2

134 Planning and Documenting an HA Cluster

Page 134
Image 134
HP Serviceguard manual Cmcheckconf -v -P $SGCONF/pkg1/pkg1.conf, Cmapplyconf -P $SGCONF/pkg1/pkg1.conf