HP-UX Event ManagerProgrammer's Guide
The process of taking an existing event channel and making it accessible through EVM is termed
encapsulation.
EVM event channels are configured through the channel configuration file. This file is read by
the EVM channel manager when EVM starts, and is also used by command-line utilities when
channel information is needed. When you modify this file, you must inform the channel manager
of the change by entering the following command:
evmreload -c
For more information about the syntax of the channel configuration file, see evmchannel.conf(4).
You can encapsulate an event channel by providing a set of executable programs to handle
various channel functions. Following are the channel related functions:
• The get function — Retrieves historical events from the channel when evmget is run.
• The details function — Provides a detailed display of an event stream when evmshow is
run with the -d option.
• The explain function — Provides explanatory text for an event stream when evmshow is
run with the -x option. This function is also typically invoked by the channel's details
function.
• The monitor function — Executed periodically by the EVM channel manager to check the
channel status and post events if necessary.
• The cleanup function — Executed daily by the EVM channel manager to perform any
cleanup actions necessary for the channel.
Each of these functions is optional, and is defined for the channel by including the appropriate
entry in a channel definition in the channel configuration file. Channel functions can be any kind
of executable file.
Channel functions that use temporary files must clean up the files before exiting, and the functions
must also be able to clean up if they are interrupted.
You must also perform the following actions:
• Add event templates for any events which may be posted or retrieved through a new event
channel. For more information about adding event templates, see “Designing Event
Templates” (page 24) .
• Ensure that the events are given the correct posting and access privileges, by modifying the
EVM authorization file as necessary. For more information about how to control access to
events, see the HP-UX System Administration document.
The Get Function
The channel get function is executed by the EVM get_server, which is executed by the EVM
daemon to handle event retrieval requests made through evmget. This function is always
executed as superuser and must take appropriate security precautions.
The function must support the following invocation syntax:
function-name [-f filter-string]
If required, other arguments may be passed to the function by including them in the function's
line in the channel configuration file.
When you run the get function, it performs the following actions:
• Retrieve events from the channel's log files
• Convert them to EVM event format
• Write the EVM events to its stdout stream.
If a filter-string is supplied, only events that match the filter can be written to stdout.
Error messages can be written to stderr and are passed back to evmget for output to its stderr
stream. Hence, ensure that they are clearly identified as originating in this function. Do not write
anything other than EVM events to stdout.
Adding an Event Channel to EVM 53