HP-UX Event ManagerProgrammer's Guide
supply a get function, instead allow the events to be logged by the EVM logger as they are posted.
This consumes more storage space, because the events are stored in two places, but it may
significantly improve retrieval time and programming effort.
If you supply your own get function for the channel, be sure to change the filter strings in the
EVM logger's configuration file, so that your events are not duplicated in the EVM log. For more
information on how to change the logger's configuration file, see the HP_UX System
Administration document.
The Details Function
The details function is invoked by evmshow command line with -d option. Although the
function is currently run with the privileges of the user running evmshow, it is likely to change
in a future release. Hence, it is important that the function takes appropriate security precautions.
The function must support the following invocation syntax:
function-name [arguments]
If arguments are specified in the details function line in the channel configuration file, they are
passed directly to the function when it is executed. The details function must accept a stream of
EVM events through stdin, and display a stream of text on stdout that describes the contents
of each event. Various forms of evmshow (notably -x and -D) are likely to be useful in producing
the output. However, you must not use the -d option because it results in a recursive loop.
Unless redirected, messages written to stderr appears on evmshow's stderr stream. Hence,
if needed, they must be clearly identified as being written by this function.
You can use the evmlog channel function,
/usr/share/evm/channels/evmlog/evmlog_details as a model for developing a details
script for a new channel. If you do not supply a details function, evmshow displays a formatted
dump of the contents of any event belonging to the channel whenever a detailed view is requested.
The Explain Function
The explain function is executed by evmshow when the command is invoked with the -x
option. Although it is currently executed with the privileges of the user executing evmshow, this
is likely to change in future release. Hence, it is important that the function takes appropriate
security precautions. The function must support the following invocation syntax:
function-name event-name [reference]
The explain function is invoked with the name of the event requiring explanation and an optional
reference value. If supplied, the reference is the contents of the event's reference data item. If no
reference is available, evmshow passes a hyphen (-) for this argument, but the function must also
allow the argument to be omitted.
The explain function must use its arguments to produce a formatted explanation for the supplied
event name, and write it as lines of text to stdout. If no explanation can be found, an appropriate
message must be written to stdout in place of the explanation. Unless redirected, messages
written to stderr appears on evmshow's stderr stream. Hence, if they are needed, they must
be clearly identified as being written by this function.
Your explain function can invoke the evmlog explain function,
/usr/share/evm/channels/evmlog/evmlog_explain, provided the following conditions
are met:
• In addition to the event-name argument, you pass a reference argument of the form:
cat:catalog-name[:set_number]
Where:
- catalog-name is the name of an I18N catalog file containing the explanations for your
channel's events
Adding an Event Channel to EVM 55