You can register an event by adding a template file entry
as described in “Event Templates”,
and entering the evmreload command with the -d option to make the events known to the Event Manager daemon,
or restarting the system.
You can use the evmwatch -i command to
retrieve a list of registered events. Pipe the output from the evmwatch
-i command to the evmshow command to display the event templates in any desired
format. For example:
# evmwatch -i | evmshow -t "@name [@priority] @format" -x |
Templates are returned as binary events which you can either
redirect in to a file or pipe to the evmshow command for display. In the previous example, the show-template
(t option) displays the name of the event, the
priority, and the message format. The x option
causes each summary line to be followed by an explanation of the
event.
You must specify a command sequence that requests only the
event's message format, not an expanded message, because you are
displaying templates (not real system events). In the output, the
summary lines display the messages with names of variables rather
than their values, as shown in the following summary line and explanation:
sys.unix.procsm.category.create[200] ProcSM:A category “$_catname” has been added. This informational event is posted by ProcSM module to indicate that a new category has been added to Process Set Manager.
|
In this example, the $_catname variable is replaced by the category name when you
use the evmget command to retrieve a posted instance of the event.
If you do not want to see all registered events, use a filter
to limit the output of the evmwatch command to the events in which you are interested, as
follows:
# evmwatch -i -f '[name *.evm]' | evmshow -t "@name \ [@priority] @format" -x |
 |
Using the -A Option to Simplify the Command
String |
 |
The Event Manager commands are designed to be building blocks,
with each command performing a specific operation. This provides
you with flexibility in developing shell scripts to manipulate event
information. When you enter commands from the command line, you
may prefer to simplify the command.
The most common command sequence for event retrieval is the evmget command, piped in to the evmsort command, piped in to the evmshow command. You can then pipe the text output in to the more command
to display the output. Consider the following example:
# evmget -f '[pri >= 600]' | evmsort -s "priority-:timestamp+" | evmshow | more |
You can simplify the previous command by using the evmget
-A command option, which automatically pipes the command
output to other Event Manager commands. For example, you can use
the -A option to simplify this command as follows:
# evmget -A -f '[pri >= 600]' -s "priority-:timestamp+" | more |
When the evmget -A command starts, it automatically runs the evmsort -A command, and pipes its output in to that command. When
the evmsort command starts, the A option causes
it to start the evmshow command, piping events into it for display. You can supply
a sort specification with the s option and a show-template
with the t option. These options are sent to the evmsort command and evmget commands, respectively.
The evmwatch command supports the -A described in “Monitoring Events”.