HP-UX Event ManagerProgrammer's Guide
Matching the Names of Posted Events with Event Template Names
Each time an attempt is made to post an event, EVM searches its template database for the
template whose event name matches the name of the posted event. If no match is found, EVM
returns an error code to the program that posted the event. If a match is found, EVM then combines
the data items held in the template with the items supplied by the posting program. This operation
generates the merged event that is distributed to subscribers. For more information about merging
operation, see “Merging Data Items from Templates and Posted Events” (page 26).
The template-matching process requires a match only between the leftmost components of a
posted event's name and all of the components of a template event's name. EVM searches for
the best match in its database, using the following rules:
• The closest match is the template event whose name exactly matches the most components
of the posted event, when compared from left to right.
• A match is considered to have occurred if the posted event has at least as many components
as the closest database entry, but not if it has fewer components.
• Components must match exactly.
• At least two components are required in the template name, and at least three are required
in the name of the posted event.
HP recommends that you provide a separate template for each distinct event your application
posts, because this enables you to centralize the event's unique information by storing it in the
template. However, the benefit of the best-match mechanism is that it enables you to extend an
event's name with different instance information each time you post it; for example, you can add
a device name or temperature value as additional components. These additional instance
components makes it easier to filter and sort events. For examples of ways to extend an event's
name, see “Reserved Component Names” (page 17) .
Table 2-5 lists some examples of event name matching between event templates and posted
events.
Table 2-5 Name Matching Examples
MatchTemplate Event NamePosted Event Name
Yes
myco.myprod.envmyco.myprod.env
Yes
myco.myprod.env.tempmyco.myprod.env.temp.high.70
No — the posted event has
few components
myco.myotherprod.startmyco.myotherprod
Merging Data Items from Templates and Posted Events
After the EVM daemon successfully validates a posted event, it merges the data items contained
in the posted event with any data items contained in the template, and distributes the merged
event to any clients that have subscribed to the event. The merge process provides the event
designer maximum flexibility in deciding which text and data items are to be provided by the
template and which are to be provided by the poster.
Figure 2-1 illustrates the concept of event merging.
26 Event Manager Events