Background documentationevent_dispatcher Locate this document in the navigation structure

 

This DBM command allows you to manage the event dispatcher function for a database. The event dispatcher only works if X server is running on the database computer.

You can use options to display the event dispatcher function, switch it on and off, create links between events in the database and executable programs, and delete these links.

Before programs can be linked to events, a member of the administrator group for the current computer must create a file with the name dbm_whitelist.cfg in the run directory of the database. This must contain complete absolute paths to the programs that are to be linked to events. One path must be entered per line.

Note Note

For reasons of security, it is only possible to create a link between an event and a program if the program is listed in the file dbm_whitelist.cfg.

The exception to this rule is program SDBMAIL. It does not need to be entered explicitly in the file, as the system accesses a function on the DBM server to execute it.

You can use SDBMAIL to send e-mails when events occur (see section “Example”)

End of the note.

Caution Caution

Please note: if powerful programs such as cmd.exe are entered in the dbm_whitelist.cfg file, this enables extensive manipulations of the entire system.

End of the caution.

You use the event_dispatcher DBM command to define the program you wish to execute, the event for which it is executed, and the properties of that event. It is possible to define events of the same category for different threshold values and then link them to different programs.

There are a number of variables that you can use in the execute command; the system replaces them with the values listed in the “Options” table at runtime. Separate multiple variables by spaces.

If the execute command contains spaces, you need to put the command in double quotation marks. If arguments within an execute command contain quotation marks, the quotation marks must be preceded by a backslash (\).

Links between events and programs only result in actions if the event dispatcher is switched on. If you define a link while the event dispatcher is switched on, the link takes effect immediately.

Prerequisites

  • You have the server authorization SystemCmd.

  • The file dbm_whitelist.cfg exists in the run directory of the database instance and is owned by an administrator of the current computer. The file contains the absolute path for the program that is to be linked to the event.

    Note Note

    The program SDBMAIL can be linked to events without being listed explicitly in the file. The file must, however, exist.

    End of the note.
  • The current operating system user can access and execute the program that is to be linked to an event.

Structure

event_dispatcher ON | OFF | SHOW | <delete_spec> | <add_spec>

<delete_spec> ::= DELETE <entry_ID>

<add_spec> :: = ADD <definition>

<definition> :: = NAME == <event_name> PRORITY == LOW | MEDIUM | HIGH [VALUE1 == ≤ | ≥ | | < | > <value>] [VALUE2 == | ≤ | ≥ | | < | > <value>] Command == <execution_command>

<execution_command> :: = SDBMAIL | <program_definition>

<program_definition> :: = <program_path> [<command_line>]

Options

Option

Description

ON | OFF

Switches the event dispatcher function on or off

SHOW

Displays the event dispatcher function

<entry_ID>

ID of the link between an event and a program that is to be deleted

NAME == <event_name>

Event name

Maintain the capitalization in the entry.

PRORITY == LOW | MEDIUM | HIGH

Event priority returned by the database core

VALUE1 == | ≤ | ≥ | | < | > <value>

Value VALUE1 returned by the database core for the event; the system is to compare this value to value <value>

VALUE2 == | ≤ | ≥ | | < | > <value>

Value VALUE2 returned by the database core for the event; the system is to compare this value to value <value>

<program_path>

The absolute path listed in file dbm_whitelist.cfg for the program that is to be executed

Observe the case-sensitivity when making your entry.

<command_line>

Command line to be executed in the specified program

You can use the following variables:

$DBMUSERPW$: Name and password of the first DBM operator (for logging the event dispatcher on to the database instance)

$EVTNAME$: Name of the event

$EVTVAL1$: Value for VALUE1, which is returned by the database system as soon as the event occurs (see output of event_list_categories <event_category>)

$EVTVAL2$: Value for VALUE2, which is returned by the database system as soon as the event occurs (see output of event_list_categories <event_category>)

$EVTDATE$: Date on which event was triggered

$EVTTIME$: Date on which event was triggered

$EVTTEXT$: Contents of field TEXT, which is returned by the database system as soon as the event occurs (see output of event_list_categories <event_category>)

$EVTCOUNT$: Sequence number of the event

$EVTPRIO$: Event priority

$SERVERNAME$: Name of the database computer

Result

OK

More Information

Using Database Events

Database Administration, Automating Administration Tasks