HP-UX Event ManagerAdministrator's Guide

Using Event Manager
Monitoring Events
Chapter 2 43
The -A option simplifies the command string by running the evmsort
command and the evmshow command automatically. The evmwatch
command also supports the -A option and automatically runs the
evmshow command when you use it. You can specify a show-template as
an option to the evmwatch command as follows:
# evmwatch -A -f "[priority >= 400]" -t \"@timestamp \ [@priority]
@@"
As with the evmget command, you can capture a set of interesting events
in a file, to review later. It is more useful to store events in binary form
than in text form, so you should send the output of the evmwatch
command directly to a file, as shown in the following example, rather
than piping it into the evmshow command first.
# evmwatch -f "[priority >= 400]" > my_events
The evmwatch command supports additional options that are useful for
monitoring events from within a shell script. Refer evmwatch (1) for
more information.
Posting Events Using evmpost
Although most events are likely to be posted by system and application
software, there may be times when you want to post an event from the
command line or from a shell script. For example, you may want to post a
message event in the evmlog to note that a task is complete, or that you
noticed something interesting. Making an entry in the evmlog makes it
easy to establish when other events occurred relative to your entry.
You can post an event by using the evmpost command. The simplest form
of this command is the quick message form, which you can specify by
using the -a (administrator) or -u (user) option. To post a message, you
must supply the message on the command line as a quoted string:
# evmpost -a "Fire drill started - evacuating computer room"
Administrative quick messages are posted with the name
sys.unix.evm.msg.admin, so that you can search for them with a name
filter:
# evmget -f '[name *.msg.admin]' |
evmshow -t 'timestamp [@priority] @@'
27-Jun-2000 15:40:49 [200] EVM admin msg: Fire drill started
- evacuating computer room