evmpost.1 (2010 09)

e
evmpost(1) evmpost(1)
The following example is successful, even though it does not display any useful information:
echo ’event { }’ | evmpost -r | evmshow
Unformatted event "(no name)";
The -r option can verify event source and template files by piping the output into
evmshow. See
evmshow(1).
Options
-r Does not post the events, but instead passes them directly to
stdout as raw EVM events.
An error occurs if
stdout is directed to a terminal device.
-m When used with the -r
option, causes event template items and environmental values to be
merged with the items included in the source. This is the default mode.
-M When used with the -r
option, inhibits the merging of template items and environmental
values.
-a msg Posts an administrators quick message event with the name
sys.unix.evm.msg.admin
and the string msg in a variable data item. If a message contains spaces, the message must be
enclosed in quotation marks (""). The event is used to add a message entry in the event log.
This option may be used only by privileged users.
-u msg Posts a users quick message event with the name
sys.unix.evm.msg.user and the string
msg in a variable data item. If a message contains spaces, the message must be enclosed in
quotation marks (""). The event is used to add a message entry in the event log.
-p priority
Assigns priority as the event priority for an administrator’s or user’s quick message. The
priority value must be an integer in the range 0-700. If the priority is not specified, the default
of 200 is used.
Operands
filename Read event sources from filename .Iffilename is omitted, or is specified as
-, event sources are
read from
stdin.
RETURN VALUES
The following exit values are returned:
0 Successful completion.
not 0 An error occurred.
EXAMPLES
The following example posts an event, provided that a template file containing an event with a match-
ing name has been registered with the EVM daemon.
echo ’event { name myco.myapp.test.start }’ | evmpost
The following example interprets an event template file, and displays a dump of the contents of each
event. Environmental items, such as a timestamp, are not merged into the event. This command
checks the syntax and contents of the file.
cat myevents.evt | evmpost -r -M | evmshow -D
The following example shows how evmpost is used in a shell script to signal completion of some
operation:
#! /bin/ksh
do_backups # A script file that does periodic backup
if[$?-eq0]
then
EVNAME=myco.ops.backup.ok
else
EVNAME=myco.ops.backup.failed
fi
echo "event {name $EVNAME}" | evmpost
The following example must be run as root to post an administrator’s message event.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010