Writing Monitors for the Event Monitoring Service (December 1999)
48 Chapter2
The EMS Application Programming Interface (API)
Function Descriptions
rm_notify
This function is used by monitors to inform EMS of an event or the
current value of a resource. If EMS determines that the resource value
meets the notification criteria specified in a monitor request, then EMS
will send notification to a target application. This function is called for
the following event types:
• RM_RESOURCE_UPDATE_EVENT
This is the most common call through the EMS request processes. See
the section, “Processing a Resource Update Event.”
• RM_SELECT_EVENT for asynchronous notification
• RM_TIMEOUT_EVENT for non-EMS GUI defined timeout events
Function Prototype
int rm_notify ( 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
The information about the current resource value that the EMS
API needs to be able to determine whether to send a Notification
Message.
Returned Value
Upon successful completion, rm_notify() returns 0. If an error occurs,
the value returned is -1, and error_code is set to one of the values
described in the file /opt/resmon/include/resmon.h.
Usage Notes
It is acceptable for a resource monitor to attempt to “fix” a resource that
has met the notification criteria. For example, if a LAN monitor discovers
that the state of a LAN card is DOWN, the monitor may attempt to reset
the card. If successful, the monitor would report a value of UP to
rm_notify(). Resource monitors that have the intelligence to perform
local recovery or local failover would operate in this fashion. Local