Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 3 71
Creating a Resource Monitor
Defining the Resource Dictionary Hierarchy
in a Subclass Reply. Refer to the section, “Processing a Subclass
Request Event.”
• For resource classes that contain a static list of resource instances,
whose names never change, create an entry in the resource dictionary
for each resource instance.
File Naming
The /etc/opt/resmon/dictionary/DEFAULT file contains the structure
and hierarchy of expected resource classes. EMS delivers the topmost
resources in this file. EMS reads and uses your resource monitor
dictionary file to extend the default class hierarchy.
Follow the listed naming conventions for your resource dictionary file:
• Specify all your resource dictionary entries in one file.
• Use a name that is not likely to be used by other resource monitor
providers.
All resource dictionary files are installed into one resource dictionary
directory, so it is important that the names of the files from two resource
monitors do not collide. As a suggestion, use a name related to the type of
resources that is being monitored, an underscore, a two-digit version
number, and a .dict extension. For example, a dictionary file for FDDI
LAN monitors might be called
/etc/opt/resmon/dictionary/fddi_01.dict.
Follow the listed rules when adding your monitor to the dictionary file:
• The order of entries in each dictionary file is not important. The
Registrar sorts the tree of all resource dictionary entries.
• Resources may appear anywhere in the file.
• Do not duplicate resource information.
The Registrar only recognizes one entry name, if there are duplicate
records, the last one read is the one used. Any earlier records and
their information is not used and therefore is essentially lost.
Additionally, if the resource monitor returns additional information
about the resource classes, the resource dictionary entry is
overwritten by the resource monitor. Again, the last definition (in this
case from the resource monitor) is used.