You can do this by using the disk monitor capabilities of the System Fault Management, available as a separate product, and integrating it in Serviceguard by configuring generic resources in packages.

Monitoring can be set up to trigger a package failover or to report disk failure events to Serviceguard by writing monitoring scripts, which can be configured as a service in a package, as shown in the example that follows:

Consider a physical volume /dev/dsk/c5t0d1 that is a part of the volume group vg_dd0 configured in a package pkg1. Your package configuration file (snippet) will look like this:

package_name

pkg1

vg

vg_dd0

service_name

sfm_disk_monitor

service_cmd

$SGCONF/pkg1/sample_generic_resource_disk_monitor.sh

generic_resource_namesfm_disk

generic_resource_evaluation_type during_package_start

The example above will monitor the health of the disk /dev/dsk/c5t0d1 in the volume group vg_dd0. The monitoring script gets the status of the disk (cmgetresource(1m)) via System Fault Management and sets the status of the disk using cmsetresource(1m).

If the sfm_disk fails for some reason as reported by SFM, then the monitoring script will set the status of the resource to 'down' causing the package to fail.

NOTE: Specifying the generic_resource_evaluation_type is optional. If not specified, the default value is during_package_start.

For more information, see:

System Fault Management documents at http://www.hp.com/go/hpux-diagnostics-sfm-docs

“Using the Generic Resources Monitoring Service” (page 57)

“Monitoring Script for Generic Resources” (page 390)

“Getting and Setting the Status/Value of a Simple/Extended Generic Resource” (page 135) and the manpages

Using EMS to Monitor Volume Groups

You can use EMS (Event Monitoring Service) resource monitors to monitor the status of LVM volume groups used by packages. You do this by defining a resource for the package, as in the example that follows.

NOTE: EMS cannot be used to monitor the status of VxVM disk groups. For this you should use the volume monitor cmvolmond which is supplied with Serviceguard. cmvolmond can also monitor LVM volumes. See “About the Volume Monitor” (page 128).

resource_name /vg/vgpkg/pv_summary resource_polling_interval 60 resource_start AUTOMATIC resource_up_value = UP

The example above will monitor all PV links for the volume group vgpkg. As long as all devices within the vgpkg volume group are functional, the resource will remain in UP status. When the last path to the storage for the volume group fails, or any device within the volume group fails, the resource value will change, and at the next polling interval the package will fail because the resource no longer meets the package requirements. The package can then fail over to any other node for which this resource is still in the UP status.

LVM Planning 101

Page 101
Image 101
HP Serviceguard manual Using EMS to Monitor Volume Groups