HP-UX Event ManagerProgrammer's Guide
Table 2-3 Substituting Variables into Event Text
Resulting TextVariable Data ItemFormat Data Item
Application started
None
Application started
Debug message: Checkpoint
reached
msg (string) =
"Checkpoint reached"
Debug message: $msg
Temperature too high: 87.2temp (float) = 87.2Temperature too high:
$temp
This event was posted by jem
None
This event was posted by
@user_name
Event Priority Data Item
The priority of an event is used as the basis for selecting events for logging, sorting, reviewing,
and taking action — human or automated. The priority is not used to establish the order in which
events are delivered to subscribing EVM clients; events are delivered in the order in which they
are received by the EVM daemon. The priority is an integer value in the range 0-700, with 0 being
the least significant priority. For information about various priority levels, see EvmEvent(5).
You can expect that system administrators respond to event priorities in the following ways:
• Configure the logger to log all events with priority 200 (notice level) or higher.
• Configure the logger to send mail or issue an alert (for example, page someone) when an
event of priority 600 (alert level) or higher is posted.
• Use evmshow command to search for all events with priority 300 (warning level) or higher.
• Use evmshow command to view logged events of all priorities to analyze problems or to
verify that the system is operating correctly.
Consider the following guidelines while working with event priorities:
• Do not hardcode the priority into the posting code. The priority must always be established
in the template file.
• When choosing the priority of an event, try to be consistent with other events in your own
application and other similar applications. Do not try to use the full range of possible priorities
if they are not applicable to your application. Use the priority information provided in
EvmEvent(5) as a guideline, and check the existing templates to find out what priorities are
being used by similar events.
• Choose the priority of an event carefully and objectively. You must consider what you are
reporting, not the possible consequences. For example, some application failures are critical,
but many are not. The determination of which applications are critical must be left to a
higher-level component. The higher-level component can subscribe to error events and issue
a critical-level event if it is notified of an application error that it is critical.
• Based on these considerations, events that indicate an error situation, but do not necessarily
meet the critical criteria must be given a priority of 400 (error level), not 500 (critical level).
On the other hand, an event reporting an excessive system temperature is almost always
critical.
• Event priorities for events that are related to each other must be established independently
of each other. For example, if you post a failure event with a priority of 500 to indicate that
an application has failed, and later you post a related event to indicate that is restored, the
second event must have a lower priority, for example, 200. Giving the restore event a priority
of 500 may cause an action that is not appropriate for the event.
I18N Catalog Name, Message Set ID, and Message ID Data Items
If your events contain text that is likely to be viewed by administrators in different countries,
consider internationalizing them. To internationalize your events, you need to supply an I18N
catalog file containing the format strings for all the events.
20 Event Manager Events