Writing Monitors for the Event Monitoring Service (December 1999)
136 Chapter4
Testing a Resource Monitor with montest
How montest Works
How montest Works
The montest tool performs the following tasks in the process of verifying
the user’s resource monitor:
1. Verifies the resource name. Successful name verification means that
the resource was listed in the resource dictionary or that the resource
monitor was able to receive an RM_SUBCLASS_REQUEST and send the
appropriate RM_SUBCLASS_REPLY back to the Registrar.
If the resource name is not verified, montest will print the following
message and exit:
You specified an invalid resource name.
2. Sends a monitor request to the Registrar using rm_send_request()
and receives the Registrar’s reply with rm_recv_reply(). If these
calls are successful, the communication path between the Registrar
and the resource monitor is verified.
If the rm_recv_reply() fails, the error codes returned may indicate a
problem with the socket (RM_INVALID_SOCKET_PARAMETER,
RM_NO_MONITOR_FOUND or RM_SOCKET_ERROR) or a problem with the
object returned to the client (RM_INVALID_OBJECT).
Additionally, the reply from the Registrar may indicate the following
errors:
• RM_NO_MONITOR_FOUND—No resource monitor was found that
claimed ownership of this resource.
• RM_POLLTIME—The resource monitor does not support the polling
interval specified by the client.
• RM_RESOURCE_NOT_DEFINED—A monitor was found that normally
monitors this resource, but the resource is not currently defined.
• RM_RESOURCE_NOT_SUPPORTED—The resource is not supported by
this resource monitor.
• RM_REJECT—The resource monitor refused to monitor the resource
for unspecified reasons.
If one of these errors occurs, montest will print the message Monitor
request failed:
error_type