Background documentationevent_dispatcher Locate this document in the navigation structure

 

With this command you can 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 is required to create a file with the name dbm_whitelist.cfg in the run directory of the database. In this file, enter the complete absolute paths to the programs that are to be linked to events. Enter one path 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 the SDBMAIL program . 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.

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

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

If the execution command contains spaces, you need to put the command in double quotation marks. If arguments within an execution 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 on. If you define a link while the event dispatcher is on, the link takes effect immediately.

Prerequisites

  • You have the server permission SystemCmd and EvtDispMgm.

  • The file dbm_whitelist.cfg is stored in the run directory of the database. It is owned by an administrator of the current computer.

  • The file dbm_whitelist.cfg 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 kernel

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

Value VALUE1 returned by the database kernel 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 on the event dispatcher to the database)

$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 the event was triggered

$EVTTIME$: Date on which the event was triggered

$EVTTEXT$: Contents of the 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

Example

Database Manager CLI Tutorial

Event-controlled sending of e-mails

Event-controlled copying of automatically created log backups

More Information

Using Database Events

Database Administration, Automating Administration Tasks