# Event Monitoring

An event monitor data object essentially keeps track of one or more vectors or scalars, and performs a specified action when a specified condition involving the vectors or scalars is true. Event monitors are usually used in conjunction with live, or streaming data. For example, an event monitor could be created to monitor whether or not elements of a data vector representing temperature exceed a predefined value.

## Event Monitor Dialog

The following is a screenshot of the window displayed when creating or editing events. Explanations of the settings are listed below.

Event Monitor Window Event Monitor Window

### Expression

The condition to monitor for, along with other event properties, can be modified in this section.

Operators

- A list of available operators. Choosing an operator from the list inserts the operator at the current insertion point in the Expression text box.

Vectors

- A list of the current vector objects in &kst;. Choosing a vector from the list inserts the vector at the current insertion point in the Expression text box.

Scalars

- A list of the available scalar values. This list is composed of both the scalar values in the current &kst; session as well as some built-in constants. Choosing a scalar from the list inserts the scalar at the current insertion point in the Expression text box.

Expression

- The expression to monitor. You may type directly in this textbox, or select items to insert using the above drop-down lists. Ensure that the expression entered in this textbox is a boolean expression (i.e. it evaluates to either true or false). This usually entails using an equality or inequality in the expression. Note that vectors entered in the textbox will be monitored according to their individual elements.

  Whenever this expression is true, the event will be triggered. The action taken upon an event trigger depends on the settings specified in the next two sections.

Description

- This textbox is used to store a short description of the event. The description is primarily available as a method for keeping track of multiple events. You can enter any text you wish in this textbox.

### Kst Debug Log

This section specifies settings for entries added to the &kst; debug log when events are triggered.

Log as:

- Enable this checkbox to have entries added to the &kst; debug log when this event is triggered. There are three types of entries in the debug log—notices, warnings, and errors. Select the desired type of entry using the corresponding radio button.

### E-Mail Notification

In this section, settings for sending e-mail notifications of event triggers can be specified.

Notify

- Enable this checkbox to have &kst; send e-mail notifications to the specified address when this event is triggered. Also enter in the email address you would like to appear in the From field of the email in the Sender textbox.

### ELOG

&kst; supports adding entries to an ELOG logbook upon event triggers. This can be useful for remotely monitoring live data, or for obtaining summaries of event activity.

Notify

- Selecting this checkbox enables ELOG logging functionality for this event monitor. Click Configure... to specify server and logging settings.

## The ELOG Extension

The ELOG extension allows event monitors to create logbook entries on a server running the Electronic Logbook (ELOG) application. The created logbook entries can be used, for example, to remotely monitor &kst; events or to produce periodical reports on data. For information on configuring and maintaining an ELOG server, please see the official ELOG Homepage. To enable the ELOG extension in &kst;, select Extensions... from the Settings menu and ensure that ELOG Extension is checked.

### Server and Logging Settings

Server and logging settings should be configured if ELOG functionality is enabled for an event monitor object. To configure logging settings, click the Configure... button in the ELOG section of the Event Monitor dialog. The ELOG Event Entry dialog should be displayed:

Event Monitor Logging Settings Event Monitor Logging Settings

Use the three checkboxes at the bottom to select the type of information to be logged. Include Kst capture specifies that a screen capture of the currently active window should be included in the entry. Include Kst configuration file specifies that `*.kst` save file should be attached to the entry. Finally, if Include Kst debugging information is checked, a copy of the debug log will be attached to the entry as well.

Additional fields will appear in this dialog once ELOG server settings are configured. To customize ELOG server settings, click the Configuration... button. The following dialog should be displayed:

Event Monitor Server Settings Event Monitor Server Settings

Descriptions of the settings in this dialog follow.

Configuration, Save, and Load

- The Configuration drop down list contains a list of saved ELOG server configurations. To load a set of configuration settings, select an item from the list and click the Load button. To save the current configuration settings in this dialog into a slot, select the desired slot and click the Save button.

  Saving settings into a slot overwrites any existing settings in that slot.

IP address and Port number

- Enter the IP address of the machine running the ELOG server application. The port number that the ELOG server listens on is configurable through the server, but by default it is 8080, so if you are unsure, enter 8080 as the port number.

Logbook

- Each ELOG server can contain one or more logbooks, so the name of the logbook to write entries to must be specified. Ensure that the spelling of the logbook is correct.

User name, User password, and Write password

- Depending on the how the ELOG server application is configured, these settings may or may not be necessary. If they are, enter the correct login credentials in the appropriate textboxes.

Capture size

- Use this list box to select the size, in pixels, of the &kst; screen capture to attach (if specified).

Submit as HTML text

- If this checkbox is selected, HTML tags may be used in the logbook entry.

Suppress e-mail notification

- If the logbook is configured to send e-mail notifications of new entries, selecting this checkbox will disable the notifications. Note that this option is not related to &kst;'s own e-mail notification setting for event monitors.

Click the Apply button to apply the entered settings. Click Update to update the ELOG Event Entry dialog (the previous dialog). Additional fields should appear in the ELOG Event Entry dialog. These fields are unique to the selected logbook. Once you are satisfied with the settings, the Test button can be used to send a test logbook entry. Click Close to exit the dialog.