HP-UX Event ManagerAdministrator's Guide
Using Event Manager
Monitoring Events
Chapter 244
By default, the message is posted as a notice event, with a priority of 200.
You can change the priority with the -p option. For example, setting the
priority to 400 categorizes the message as an error event as follows:
# evmpost -p 400 -a \
"Users reporting possible network problems"
By default, only the superuser or members of the adm group can post
events with the -a option, although you can make it available to other
privileged users by editing the authorization file, /etc/evm.auth, as
described in “User Authorization” on page 73. Any user can specify the
-u option to post messages in the same way. If on necessary, you can
restrict this privilege to trusted users by editing the authorization file.
Posting Events from a Shell Script
Use the evmpost command to post a newly registered event, by passing
the event information to the command in source (text) format. For more
information about the event syntax, see evmpost (1). Source-level posting
is useful in a shell script that performs a routine operation, where the
event may indicate success or failure of the operation. This section
describes the steps to create and post a new event that informs when a
backup is complete. To create and post new events, complete the
following steps:
Step 1. Create a template file, and verify its syntax.
Step 2. Install the template file, and make it known to the Event Manager
daemon.
Step 3. Update the authorization file to allow the events to be posted.
Step 4. Write shell script commands to post the event.
For more information about event design guidelines, see the Event
Manager Programmer’s Guide. You should be familiar with the concepts
described in that book before you begin designing a new event. In which
example, the backup script posts one of two events,
local.admin.backup.ok with a priority of 200 (notice) and
local.admin.backup.failed, with a priority of 400 (error). The failure
event includes a variable item named result_code, to hold the exit code
returned by the backup program. The variable is an 8-bit unsigned
integer, and in the template it has a dummy value of zero. This dummy
value is replaced with an actual value when the event is posted. The
template file syntax is described in the evmtemplate (4) .