HP-UX Event ManagerProgrammer's Guide

Comparing Event Names
Use EVM's API functions to compare the name of an event with the name you are looking for.
Do not use strcmp; the name of the incoming event may have more components than you
expected. For more information on event name matching, see “Matching Event Names” (page 50).
Event Format Data Item
The format data item is a human-readable character string that summarizes the event. The format
line is expanded and displayed in the following situations:
When the event is displayed using the evmshow command
When a program calls a display API function such as EvmEventFormat
The format data item can include references to other data items contained in the event. Consider
the following examples:
Application close-down has started
Close-down of application $app has started
In the second example, $app is replaced by the name of the application, provided that the event
contains a variable value with that name. The line is displayed as:
Close-down of application payroll has started
For more information about variables, see “Variable Data Items” (page 21).
A format line must begin with a brief and consistent identification of the posting component,
and it must be a concise indication of what happened. Consider the following guidelines:
Do not write a full sentence, but ensure that the sentence can be clearly understood.
Do not write multiple sentences and do not include a period at the end of the message. Use
the event's explanation text to provide the full and more grammatical description of what
happened. For information on how explanation text is handled, see “Writing Event
Explanation Text” (page 24) .
Place the most important information the phrase that tells the administrator what
happened at the beginning of the line to make it unnecessary for the administrator to
look for the required information. Variable data is better placed towards the end of the line.
You need not include a reference to every variable in the format string. The administrator
can easily obtain the variable data by requesting a detailed description of the event. However,
you must include the key data, such as the name of a file system or device.
You can include variable names for substitution by preceding them with the $ character, for
example, $app. If necessary, you can include standard data items by preceding their names with
the @ character, for example, @host_name. You can specify standard data item names in uppercase
or lowercase. However, variable names are case sensitive.
You can escape the special meaning of $ and @ characters in the format text by preceding them
with a backslash (\). To include a literal backslash in the text, use a double backslash (\\). To
separate the name of the data item or variable from adjacent text, you can surround the name in
braces, for example, ${app}.
You can control the display of a variable or data item by following its name by a percent sign
(%) and a format specifier. The format specifier can include the minimum width of the display
field and the display format. For example, the following format string specifies that the variable
named device_id must be displayed in hexadecimal notation and the temperature must be
displayed as a floating-point number with 2 decimal places. For example:
The cabinet temperature for device 0x$device_id%x is $temperature%.2 degrees
The corresponding event is displayed as:
The cabinet temperature for device 0x7a is 62.4 degrees
For a full list of valid format specifiers, see evmshow(1) manpage.
Table 2-3 lists examples that show how variables and data items are substituted in to an event's
format text to produce a formatted version of the event.
EVM Event Content 19