|
|
The DMI package provides several procedures that facilitate the writing of instrumentation code, and several examples of instrumentation code that use these procedures. The DMI procedure libraries provide procedures for installing a component, invoking the Service Provider and accessing attributes. These procedures are introduced in Intro(3dmi). Implementation-specific issues for instrumentation code are included in ``Implementation specific details''. The rest of this Instrumentation code section summarizes the general issues and requirements for instrumentation code.
Instrumentation code must provide only one value at a time when invoked by the Service Provider. To be accessed by the Service Provider, all instrumentation code must support the following DMI functions as entry points:
Event Generators must utilize the Service Provider entry point, the DmiOriginateEvent(3dmi) function. Indication consumers, such as management applications, should provide functions for Event Delivery; for more information, see Section 7.1 in the DMI Specification.
Each instrumented component must register with the Service Provider as a direct interface. If you specify the keyword DIRECT-INTERFACE in the Path statement of the MIF file, the Service Provider can return an appropriate error if attributes are accessed while the direct interface program is not running.
Components must register by calling the Component Interface's Register function, DmiRegisterCi(3dmi), before doing anything else. In registering, the component passes its entry point to the Service Provider. The Service Provider passes control to the direct interface program when it needs to access the attribute value. When it unloads, a direct interface program must unregister with the Service Provider. The instrumentation code samples included with this package demonstrate how to do this.
Before installing your component into the Service Provider's MIF database and registering it, verify that the component has not already been installed or registered with the Service Provider.
To identify which ComponentID in the current MIF database belongs to your component, use the DmiListComponents(3dmi) function to list the components and search the list for the component class string that matches your component. These methods are demonstrated in the instrumentation code samples described in ``DMI 2.0 code samples''.