Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > E

evmpost(1)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

evmpost — post events to the EVM daemon

SYNOPSIS

evmpost [-r [-m|-M]] [[-a|-u msg [-p priority]] | [filename| -]]

DESCRIPTION

The evmpost command takes a file or stream of text event sources as input and converts them to binary EVM events. By default, the command then posts them to the EVM daemon for distribution.

If the -r option is specified, evmpost writes the EVM events to its stdout stream instead of posting them to the daemon. By default, evmpost attempts to retrieve event template information from the EVM daemon and merges the template items and environmental items such as user name and timestamp into the output events. If the -M option is used, the output events contain only the items specified in the source.

An event source may contain any number of events. Each event is specified in the manner shown. See the EvmEvent(5) manpage for a more detailed explanation.

event { name event_name format format_specifier priority priority var { name variable_name type variable_type value variable_value } }

The evmpost command recognizes the following data items in an event source:

  • NAME

  • PRIORITY

  • FORMAT

  • REF

  • I18N_CATALOG

  • I18N_SET_ID

  • I18N_MSG_ID

  • VAR

    • TYPE

    • VALUE

All EVM variable types may be specified except for OPAQUE. Refer to EvmEvent(5) for details on data items and variables.

In the event source, each keyword must be accompanied by a corresponding value. The value must be enclosed in double quotes ("") if it contains white space. The data item keywords that are specified outside the event body are taken as global values. The data item keywords are included in each of the following events which do not have an explicit value defined for that keyword.

Comments are indicated by a leading # character. Blank lines are ignored.

The evmpost command builds an EVM event containing the items that are explicitly specified in the source. If the event is posted or if the -r option is specified without -M, additional environmental items such as the timestamp, process id, and template items are inserted into the event automatically.

The rules for posting an event are more stringent than those for an event simply to exist. Therefore, evmpost may display an error when trying to post an an event that cannot be posted, even though the same source is accepted when using the -r option.

For example, do not post an event if it does not contain a name with at least three components because the daemon rejects it. However, such an event can exist, and evmpost can create it and pass it to stdout. The following example fails because it does not contain a name:

echo 'event { }' | evmpost evmpost: Error in input file "standard input", line 1 evmpost: Error: Event name is missing

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 administrator's 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 user's 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. If filename 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 matching 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 [ $? -eq 0 ] 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.

    evmpost -a "Power outage recovery completed" -p 250

  • The following example posts a quick user's message.

    evmpost -u "Leaving for lunch."

  • This example posts an event that includes a variable.

    evmpost << EOF event { name myco.ops.backup.ok var { name backup.vol type string value "tape 73" } } EOF

    If the template for this event contains the following format data item:

    "Backup completed to $backup_vol"

    then evmshow displays this event as:

    "Backup completed to tape 73"

WARNINGS

The evmpost command rejects attempts to output raw events to a terminal device.

Post only events for which you have posting authorization, and for which a template exists.

FILES

/etc/services

Definition of the sockets and protocols used for Internet services

/etc/evm.auth

Location of the EVM authorization file

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.