Writing Monitors for the Event Monitoring Service (December 1999)

40 Chapter2
The EMS Application Programming Interface (API)
Function Descriptions
rm_get_next_event
This function is used by monitors to determine when a message is ready
to be received from the EMS API. Normally, this function blocks until a
message has been received from the EMS API.
Function Prototype
int rm_get_next_event ( rm_select_type *select_data,
rm_return_type *return_type,
rm_object_addr *obj,
rm_error_type *error_code );
Parameters
error_code
Provides additional information about failure conditions of
the function. Valid values are listed in the file
/opt/resmon/include/resmon.h.
obj
If the return_type is RM_SUBCLASS_REQUEST_EVENT,
RM_MONITOR_REQUEST_EVENT, RM_RESOURCE_UPDATE_EVENT, or
RM_UNREGISTER_EVENT, an object of the appropriate type is created by
rm_get_next_event(). The resource monitor must free the memory
associated with that object by calling rm_destroy() when the object is
no longer needed.
return_type
Identifies the type of event that occurred. Valid values
are listed in Table 2-6:
Table 2-6 rm_return_type
return_type
Parameter Values
Type Description
RM_MONITOR_
REQUEST_EVENT
A Monitor Request message has been received from
the EMS API. The resource monitor is expected to
send a Monitor Reply. See the section, “Processing a
Monitor Request Event” for more information.
RM_RESOURCE_
UPDATE_EVENT
A timer popped indicating that an update is needed on
a particular resource value. The resource monitor is
expected to retrieve the current value of the resource.
See the section, “Processing a Resource Update
Event” for more information.