Writing Monitors for the Event Monitoring Service (December 1999)

102 Chapter3
Creating a Resource Monitor
Processing a Monitor Request Event
Sample Code
This code fragment shows how a resource monitor might respond to a
Monitor Request Event. This resource monitor supports several
resources.
RmResourceType rm_option
_type
Defines what form the resource’s
values assume. Valid values are shown
below. See the section, “EMS Resource
Types” for an explanation of these
values.
RM_RESOURCE_CLASS_TYPE
RM_STRING_TYPE
RM_ENUMERATED_TYPE
RM_SBIT32_TYPE
RM_UBIT32_TYPE
RM_FLOAT64_TYPE
RM_ERROR_TYPE
The resource monitor must set the
value of this field.
Table 3-6 Monitor Reply Object Fields
Field Name Type Description
/*****************************************************************************/
/* File: send_monitor_reply.c */
/* */
/* Processes a Monitor Request Event. */
/*****************************************************************************/
#include <monitor.h>
/*
* Resource monitor: send_monitor_reply
*
* Desc:
* Receives an event and, if it is a Monitor Request Event,
* determines whether to monitor that resource. The following
* resources are supported: