HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)

e
evmshow(1) evmshow(1)
Operands
filename Reads events from file filename.Iffilename is omitted, or is specified as
-, events are read from
stdin.
Notes
1. The -r
and -b options should not be used when output is sent indirectly to a terminal device, such as
piping the output of the
evmshow command to the
more command.
2. The
evmget and
evmwatch commands can be made to run evmshow automatically by use of their
-A options. See evmget(1) and evmwatch(1) for more information.
EXTERNAL INFLUENCES
Environment Variables
The following environment variable affects the execution of
evmshow:
EVM_SHOW_TEMPLATE
This variable contains a string formatted as described for a show_template. If the
-d, -D, -t,
and
-x options are omitted, the string is used as the show_template for output.
RETURN VALUES
The following exit values are returned:
0 Successful completion.
not 0 An error occurred.
EXAMPLES
In the following example, all available events are retrieved and piped to evmshow for formatting. The
show_template causes the events to be displayed as timestamp value, followed by the event’s priority
enclosed in brackets, followed by the formatted event message.
evmget | evmshow -t "@timestamp [@priority] @@"
This ksh example displays events in the same way as the previous example, but the show_template is
specified in an environment variable, simplifying the
evmshow command.
export EVM_SHOW_TEMPLATE="@timestamp [@priority] @@"
evmget | evmshow
The following example retrieves all available events using evmget, and sorts them into a file. In the
evmsort command, the -s option requests that the events be sorted into timestamp order, and the
hyphen character at the end of the sort specification indicates that the sort order should be descending.
This results in the most recent events appearing first. The evmshow command is then used to display
full details (indicated by the -d option) of the first five (most recent) events from the file.
evmget | evmsort -s "@timestamp-" > my_eventfile
evmshow -n 5 -d my_eventfile | more
The following example displays the value of the filter named evm, from the supplied
sys filter file.
Refer to evmfilterfile(4) for more information about filter files.
evmshow -f "@sys:evm" -F
The following example retrieves all events and displays them with the timestamp in the form
yyyy/mm/dd hh:mm:ss, followed by the priority and the formatted message. See date(1) for details
of the timestamp formatting options.
evmget | evmsort | evmshow -T "%Y/%m/%d %T " -t "[@priority] @@"
The following example watches for events of priority 600 or greater, and mails them in detailed display
format to user jim, with a subject line that identifies the event. In the evmshow command, the -t
option produces the subject line as the first line of the output, and the -d option causes evmshow to
follow the subject line with a detailed display of the event. The mail command uses the line beginning
with Subject: as the subject for the mail message.
evmwatch -f "[priority >= 600]" |
evmshow -t "Subject: EVENT [@priority] @@" -d | mail jim
The following example reads raw EVM events from the file file1 and writes the events that have a
priority of 500 or greater to file2, Because the -r option is specified, the output file contains raw
EVM events.
310 Hewlett-Packard Company 3 HP-UX 11i Version 3: February 2007