|
An alert is a response of the system to a custom user-defined event or condition.
Alerts are raised by triggers (alert conditions). A trigger can be an event, a state or a change of state of a system component/hardware device. See the triggers section for details.
When an alert is raised, the system responds to it:
| • | The alert owner may be immediately notified, if he is connected to the server. He may also be prompted to acknowledge the alert. |
| • | E-mail messages may be sent to the alert owner, to a system user(s) or to a custom E-mail address(es). |
| • | Some corrective actions may be executed, in interactive or non-interactive mode. |
| • | The alert may change its state. |

|
Every user has their own set of alerts.
|
Administering Alerts
Two contexts are used to administer alerts: One is the general Alerts context, which serves as a container. The other is the Alert context, which holds the information for one alert.
|

|
Triggers
Alerts are activated by triggers. Every alert may have several triggers associated with it. Each trigger defines a condition in which the alert should be raised. There are two types of triggers, described below:

|
Trigger: an act that sets in motion some course of events.
|
Each alert may define zero or more triggers of every type. If no triggers are defined, the alert is never raised. If several triggers are defined, they act separately -- each trigger may raise the alert (they don't all have to exist at the same time -- just one is enough to raise the alert).
Event Triggers
An Event trigger raises the alert when a certain event fires in a context, and conforms to a condition specified in trigger settings. This event may be generated by LinkServer itself or may come from a Data Terminal.
The event trigger's properties are described here. Each trigger causes LinkServer to "listen" for the event specified by the Event setting in every context that matches the Context Mask setting. When such an event is detected, the server evaluates the expression specified by the Expression setting. This expression usually refers to some data associated with the event, but it may also refer to any other data, such as the values of some context variables.

|
If the Expression parameter is not specified, every occurrence of the event will raise the alert.
|

|
Example of event trigger:
Let's say we're running a vehicle monitoring system, which has Devices in various factory vehicles. These Devices fire various events, such as the Impact event, which fires when the vehicle bumps (or crashes...) against something. So the Context Mask would match the Device monitoring the vehicle, the event would be something like impact, and we could also have an expression, referring to the strength field of the impact event, which would cause the trigger to activate if the strength of the impact exceeds a certain value.
In this case, the Event Trigger parameters may be as follows:
Context Mask
|
users.user123.devices.vehicle12_controller (This mask matches a single Data Terminal context - could be a wildcard matching several, too)
|
Event
|
impact
|
Expression
|
{strength} > 5.5
|
(Of course, impact and strength are just theoretical events coming from some made-up Device - they're not built-in LinkServer system events).
|
Event Correlation

|
Event correlation is a technique for making sense of a large number of events and pinpointing the few events that are really important in that mass of information.
|
In terms of AggreGate alerts, event correlation is a way to activate the alert by an event trigger when one ("primary") event occurs, and deactivate the alert upon another ("correlated") event.
To enable event correlation for a certain event trigger, specify the name of the Correlated event in the trigger settings. In this case:
| • | Event trigger (and the alert itself) will be activated by the event named in the Event setting (which is the "primary" event in this case). |
| • | It will be deactivated if Correlated event occurs in the same context with Event, and additionally, Correlator expression evaluates to TRUE. (It can happen that the Correlated event occurs, but Correlator expression evaluates to FALSE, thus leaving the trigger active.) |

|
Once a trigger has been activated, it switches the alert to active state.
|
The following picture illustrates activation/deactivation of event trigger by Primary and Correlated events:


|
Examples of event triggers using event correlation:
Sometimes we may want to view an alert in the Active Alerts list when a certain device is offline (not available for LinkServer). Assuming that we have connection and disconnection events in the Device context of this device, we may use the following event trigger settings to force an alert remain active when device is disconnected:
Context Mask
|
users.user123.devices.critical_device
|
Event
|
disconnection
|
Correlated
|
connection
|
This trigger will activate alert on disconnection event and deactivate it on connection event.
If there are no connection/disconnection events in the Device context, we can still use a contextStatusChanged event for the same functionality. In this case we'll have a slightly more complicated trigger setup:
Context Mask
|
users.user123.devices.critical_device
|
Event
|
contextStatusChanged
|
Expression
|
{status} == 0 (Assuming that status 0 means "device is disconnected")
|
Correlated
|
contextStatusChanged
|
Correlator
|
{status} == 1 (Assuming that status 1 means "device is connected")
|
This trigger will be activated when contextStatusChanged event occurs and status field of event data equals to zero. The same event with a status of 1 deactivates the trigger.
|
Variable Triggers
A variable trigger may raises the alert:
| • | When a variable value satisfies some condition, or |
| • | When a variable value changes (no matter to what value) |
Selection between these two methods is performed by the Monitor State Changes property of the trigger. Other properties of the variable trigger are described here.
Every variable trigger periodically inspects the value of the variable in every context matching the defined by the Context Mask setting. Polling period is defined in seconds, by the Check Period parameter. A Data Table containing the value of the variable is retrieved from the context, and then something happens, according to the Monitor State Changes setting:
| • | If Monitor State Changes is disabled, the server evaluates the expression defined by the Expression setting. This expression must evaluate to a Boolean result in this case. It may contain references to the cells of the Data Table containing the variable value, but may also refer other variables and functions of LinkServer contexts. If the expression evaluates to TRUE and the result of the previous evaluation was FALSE (or if this is the first time the variable is inspected since LinkServer was started or since the properties for this alert were last changed), the trigger fires and raises an alert. If the evaluation is TRUE and was also TRUE during the last check, no action is performed. If it changes from TRUE to FALSE, no action it performed either, but subsequent change back to TRUE will fire the trigger. |
| • | If Monitor State Changes is enabled, the Expression is evaluated every Check Period exactly like in the previous scenario, but its result may be of any type. The server will remember the last evaluation result. If the new evaluation result is different than the last one, the trigger fires and raises the alert. |
If the Context Mask parameter points to more than one context, each context is separately inspected, and the alert is raised every time the variable value satisfies the condition (or changes, depending on the Monitor State Changes setting) in any of these contexts.

|
Example of variable trigger without "monitor state changes":
Let's say we're monitoring the Current Temperature variable, coming from a temperature sensor. In this case, Expression may refer to the Celsius Temperature field of this variable and cause a trigger to fire if the temperature exceeds a certain limit.
The trigger parameters may be:
Context Mask
|
users.user123.devices.temperature_sensor (This mask matches a single Data Terminal context)
|
Variable
|
currentTemperature
|
Expression
|
{celsiusTemperature} > 100
|
Monitor State Changes
|
disabled
|
Check Period (seconds)
|
10
|
Delay (seconds)
|
0
|
Alert Level
|
Warning
|
|

|
Example of variable trigger with "monitor state changes":
Now let's say we're monitoring a Warning List variable, coming from a piece of medical equipment monitoring several critical parameters of a patient. The value of this variable is a Data Table with up to five records, and every record has a single String field called Warning, containing a textual warning about the state of patient. In this scenario, the Expression may aggregate all warning messages by appending them to each other, and activate the alert when any of the warnings is removed, added or changed.
The parameters of may look like this:
Context Mask
|
users.user123.deviceservers.medical12.devices.monitor1 (This mask matches to a single Data Terminal context)
|
Variable
|
warningList
|
Expression
|
{warning[0]} + {warning[1]} + {warning[2]} + {warning[3]} + {warning[4]}
|
Monitor State Changes
|
enabled
|
Check Period (seconds)
|
100
|
Alert Level
|
Warning
|
|
Delays and Hysteresis
Variable triggers have a Delay parameter that help to set up alerts like "Warning, temperature is less than 10 degrees for over one hour".
The Delay parameter is relevant only when Monitor State Changes is off. It defines the interval between time when the trigger expression becomes true and the time the alert is raised. If set to zero (the default), the alert is raised immediately when Expression evaluates to TRUE. When Delay is non-zero, the server waits for the specified number of seconds before activating trigger and raising and alert. If Expression evaluates back to FALSE before the Delay time expires, the alert is not raised and the time counter is reset.

|
Regardless to the Delay value, trigger expression is re-evaluated only once per Check Period (which is one of the parameters of the trigger - see above). For example, if Check Period is 10 seconds and Delay is 15 seconds alert will be raised 20 seconds after the time when expression has been first evaluated to true.
|
Variable trigger is activated if Expression is TRUE for longer than Delay time. It is deactivated if:
| • | Deactivator expression is not specified, and Expression is FALSE for longer than Deactivation Delay |
| • | Deactivator expression is specified, and it is TRUE for longer than Deactivation Delay. If you think the Deactivator expression seems very similar to the Correlator expression mentioned above, that's because it is! The main difference is that a Correlator expression may lower the alert upon Correlated Event only, while a Deactivator expression is evaluated periodically. |

|
An activated trigger switches its related alert to active state.
|
A combination of Delay and Deactivation Delay is called hysteresis.

|
Hysteresis is the lagging of an effect behind its cause.
|
The following picture shows how the variable trigger is activated/deactivated when Deactivator is not specified:

When Deactivator is specified, activation/deactivation of trigger is performed according to the following picture:


|
Example of variable trigger with hysteresis
Let's return to the one of the above examples involving temperature monitoring.
We want to set up a trigger that:
| • | Activates the alert when temperature is higher than 50 degrees for longer than 5 minutes, |
| • | Deactivates the alert when it's active and temperature is lower than 35 degrees for longer than 20 minutes. |
The trigger parameters may be as follows:
Context Mask
|
users.user123.devices.temperature_sensor (This mask matches a single Data Terminal context)
|
Variable
|
currentTemperature
|
Expression
|
{celsiusTemperature} > 50
|
Monitor State Changes
|
disabled
|
Check Period, seconds
|
10
|
Delay, seconds
|
300
|
Alert Level
|
Warning
|
Deactivator
|
{celsiusTemperature} < 35
|
Deactivation Delay, seconds
|
1200
|
|
Alert Notifications
When an alert is raised by one of its triggers, LinkServer starts dealing with notifications. Notification settings are described here.
NOTIFYING ALERT OWNER
The LinkServer user owning the alert is notified if the Notify Owner If Connected To The Server setting is enabled and this user is logged in to a LinkServer User Interface. For example, in AggreGate Client, a popup message is shown to the user:

The alert notification popup contains:
| • | Message provided by the trigger |
If the Acknowledgement Is Required parameter is enabled, the user is prompted to enter an acknowledgement text for the alert in the same popup box. Here is what it looks like in AggreGate Client:

If owner notification is enabled, you can specify a Notification sound (.WAV file) that will be played in LinkServer User Interface before the notification popup is shown.
SENDING E-MAIL NOTIFICATIONS

|
Alert notification e-mails will be sent only if mail server settings are properly configured and mail sending is enabled. See Mail Sending Settings in LinkServer Global Configuration for details.
|
LinkServer can prepare and send an alert notification e-mail message. This message may be sent to three recipient categories:
| • | Custom e-mail address(es) |
Sending mail to alert owner is enabled by the Send E-mail To Owner setting. E-mail Recipients table contains a list of LinkServer users that will receive e-mail notification.

|
Only users whose e-mail address is specified in the user profile may be added to the recipient list.
|
It is also possible to send e-mail notifications to custom e-mail addresses. These addresses should be listed in the Additional E-mail Recipients field and separated by commas.
Contents of the email:
| • | Context where the event is defined |
This is what such an email looks like:

Plain text version of alert email:

SENDING SMS NOTIFICATIONS

|
Alert notification may be sent by SMS only if SMS sending settings are properly configured and SMS sending is enabled. See SMS Sending Settings in LinkServer Global Configuration for details.
|
LinkServer can send an alert notification via SMS to a number of cellular phones. Specify recipients using the SMS recipients setting located in the Alert Notifications section.
The sender's number is defined by Sender Number Global Configuration option.

|
Example: For Impact Warning alert that may inform Vehicle Monitoring System operator about impact occurred to a vehicle, the following SMS notification will be sent:
Alert: Impact Warning
|
EXECUTING ACTIONS ON ALERTS
LinkServer is capable of running actions when an alert is raised. These are called "corrective actions" because they're intended to correct the problem automatically or by interacting with humans.

|
Corrective actions may be also used to send non-standard notifications. For example, corrective action may launch an external application to send message to a pager or beeper (check details here). Another examples would be sending Unix syslog message or Simple Network Management protocol (SNMP) trap using special actions included into AggreGate Network Management extensions.
|
Actions may be run in interactive or non-interactive mode. In non-interactive mode, all action input is pre-defined and action output is sent to the server log or written to event history. This mode is also used by the scheduler. In interactive mode, the action interacts with the alert owner by using UI Procedures. He must be logged in to an LinkServer User Interface (e.g. AggreGate Client) to allow interactive actions execution. See the action execution modes section for details.
Non-interactive execution is controlled by the Automatic Corrective Actions property. This property lets you configure multiple actions to run on alert, and has several parameters: Every action will be launched from every context matching the Context Mask parameter. Action name is defined by the Action parameter. Parameters is the list of action-specific parameters (this might be confusing, but keep in mind that Parameters here is, itself, a parameter. Get it?). These parameters are used to substitute user input when the alert processing engine executes an action in non-interactive mode. For example, if a given action requires confirmation (i.e. asks user something like "Delete query?" and lets the user click OK or Cancel), this field will contain a Delete query? parameter with two possible choices: OK or Cancel.
Interactively executed actions are listed in a table called Interactive Corrective Actions. Every action has two parameters: Context Mask and Action, which work just like in non-interactive execution (see above). There is no Parameters field in this list, since all input for interactive actions is provided by a human user.
Alert States
Alerts can be in one of the following states:
| • | Enabled ( ) |
| • | Active ( ) |
| • | Escalated ( ) |
| • | Disabled ( ) |
The initial state for a newly created alert is Enabled. This means that all triggers are enabled and may raise the alert. You can disable the alert (put it in Disabled state, technically speaking) by switching off the Alert is enabled basic option. A disabled alert is never raised and doesn't do anything, because all triggers are inactive. For descriptions of Active and Escalated states see Active Alerts and Alert Escalation below.
Active Alerts
Alert is active if:
| • | There are any pending (non-acknowledged) alerts |
The activation reason is shown in a tooltip that appears when the mouse hovers over the alert in LinkServer User Interfaces.
Pending Alerts
When an alert is raised, a special Alert event is generated and persistently stored in LinkServer database. Alert events that are not acknowledged are called "pending alert instances". See the events topic for more information about events and event acknowledgement. The pending instances of every alert may be managed using the View Pending Alerts action, defined in the Alert context. This action shows when and why the alert was raised, and lets you delete or acknowledge pending alerts. Alert instances that have already been acknowledged are not shown in the list.
When configuring an alert, one of the properties is called Allow Pending Alerts. If you disable this (i.e, disallow pending alerts for this particular alert you're configuring), the alert won't be shown in the Pending Alerts list even if it wasn't acknowledged. It also won't be escalated.
Here is what the list of pending alerts looks like (screenshot made in AggreGate Client):

When one or more unacknowledged alert events exist, the alert remains in Active state. This state is indicated in LinkServer User Interfaces by a special icon. The active state indicates that some attention is required to solve the problem indicated by an alert. When the problem is solved, system operator may launch the View Pending Alerts action and acknowledge all pending alert instances. Alert will be put back in the "Enabled" (normal) state, indicated by the icon.
Non-acknowledged instances may force alert to switch into the Active state only if the Allow pending alerts setting is enabled.
Alert Acknowledgement
Every alert raised is persistently stored as a LinkServer event (see Alert Event for details). These events may be acknowledged exactly like all other LinkServer events. Acknowledging an alert is the same as acknowledging its "Alert" event. The acknowledgement is stored in the event history, just like any other event acknowledgement. Its parameters (author, time and text) may be viewed when browsing event history (for example, using the Event Log in AggreGate Client).
E-Mail Acknowledgements
LinkServer provides an E-mail alert acknowledgement service letting operators acknowledge events by replying to alert notification e-mail message. To start using this service, enable mail receiving in Mail Settings section of LinkServer Global Configuration and configure incoming mail server properties (POP3 server address, login and password). Make sure that Check Incoming Mail scheduled job is enabled (it's disabled by default).

|
E-mail alert acknowledgements will function properly only if replies to the alert notification e-mails will be delivered to the mailbox monitored by LinkServer. Alert notification e-mails are sent with the Reply-to header set to the address specified in Sender address for mail messages global configuration setting. Thus, LinkServer must receive all e-mail that were sent to this address. This will allow notification e-mail recipients to use "Reply" function of their mail clients and enter acknowledgement text in the reply e-mail.
|
To acknowledge an alert by e-mail, reply to the alert notification e-mail and enter the acknowledgement text in the first line of reply. Alert acknowledgement will be added once the reply is delivered and received by LinkServer. LinkServer checks for new mail periodically, according to Incoming mail check period global configuration option.

|
It is important to preserve the subject of original alert notification e-mail when replying. The mail client may add text (usually "Re: "), and this is fine. However, the ID pattern in the message subject should not be removed or changed.
|
Alert Escalation
Active alerts may be escalated. Escalation is usually used to draw attention to some critical conditions. In most cases, escalated alerts, indicated with the icon, require the system operators to take quick action.
For an alert to be escalated, there has to be at least one pending (unacknowledged) instance of it, and it must satisfy at least one of the escalation rules defined by the Alert Escalation property. There are two escalation types:
With number-based escalation, an alert is escalated if the number of pending alert instances exceeds the limit specified by the Number of pending alerts requited to initiate escalation setting.
With time-based escalation, an alert is escalated if any pending instance (alert event) is not acknowledged within the time frame specified by its Time before escalation setting.
When an alert is escalated, an Escalation Notification is emailed to all recipients defined by the Notifications setting. This notification contains the time of escalation, and the reason for it:

The reason is also shown in a tooltip that appears when the mouse hovers over the alert in LinkServer User Interfaces. Here is what it looks like in AggreGate Client:

To put an alert back in pending or normal state, acknowledge some of its pending instances so that escalation rules will not be satisfied.
Alert Event
When alert is raised, a special LinkServer event is generated in the Alert context. It is called "Alert event" or "Alert instance", and has several uses:
| • | When this event is not acknowledged, it is called "pending alert instance". When an alert has pending instances, the alert itself is put into the Active state. Its icon changes to . This is similar to how an email client works -- you can see your mailbox as "Unread" if it has unread messages in it. |
| • | When you View Pending Alerts, you are actually looking at the history of all Alert Events for a particular alert. You can only access this action if the Allow Pending Alerts setting is enabled for this alert. |
Format of Alert Event:
Field
|
Description
|
Alert Name
|
Name of alert context.
|
Alert Description
|
Description of alert context.
|
Context
|
Path of context for which the alert was raised, i.e. context where event or state change monitored by alert trigger has occurred.
|
Entity
|
Event (is raised by event trigger) or variable (if raised by variable trigger) which caused the alert.
|
Cause
|
Textual description of alert's cause.
|
Message
|
Alert message. This is a manually configured string, which is supposed to be a human-readable description of the alert (i.e, "The house is on fire"). See Alert Properties below.
|
Trigger
|
Trigger message. Additional text message provided by alert trigger.
|
Alert Data
|
Data associated with the event causing the alert. This field is NULL (not defined) if the alert was caused by a certain variable state or by a variable value change. For a login event defined in the Users context, this data table will contain one record with two fields: Username and Permissions.
|
Example of Alert event:

Built-In Alerts
Device Offline Alert
Device Offline alert is built into LinkServer basic distribution package. It is raised when any Data Terminal is disconnected from the server for longer than 10 minutes.
According to its Variable Triggers, this alert is triggered only for Devices whose Enable Offline Alert setting is active.
Device Offline alert is owned by default administrator.
Alert Configuration
Alert Properties
This defines the basic options for an alert.
Field Description
|
Field Name
|
Alert Name. Name of the alert context, required to refer to this alert from other parts of the system. It should satisfy the context naming conventions.
|
name
|
Alert Description. Textual description of the alert. This is also a description of the alert context.
|
description
|
Alert is Enabled. Disabling an alert deactivates all its triggers. It will never be raised.
|
enabled
|
Message. Alert message. It will be shown in all alert notifications including visual notifications, notification e-mails, alert event etc. May be treated as an expression if Alert Message And Trigger Messages Are Expressions option is enabled.
|
message
|
Alert Message And Trigger Messages Are Expressions. Indicates that alert message and trigger message fields contain the expressions that should be evaluated when alert it raised.
|
expressions
|
These may be accessed via the childInfo variable.
Event Triggers
This defines a list of Event Triggers.
Field Description
|
Field Name
|
Context Mask. This mask is resolved during trigger processing. If the event specified by the Event parameter is fired in any context matching this mask, the trigger activates an alert. In most cases, this context mask points to one explicit context, being a context path, rather than a mask.
|
mask
|
Event. Name of the event to be monitored.
|
event
|
Filter Expression. An AggreGate Expression which must evaluate to TRUE to activate the trigger. May contain references to the cells in the Data Table associated with the Event.
|
filter
|
Alert Level. Level of this alert event. In addition to the fixed values, may be set to Same As Event (this is a default setting). In this case level of alert event will be same as level of event that caused the alert.
|
level
|
Correlated. Name of the "correlated event" that will deactivate the trigger if Correlator expression will be TRUE when it occurs.
|
correlated
|
Correlator. An AggreGate Expression which must evaluate to TRUE to deactivate the trigger when Correlated event occur. May contain references to the cells in the Data Table associated with the Correlated event.
|
correlator
|
Message. Trigger message is usually used to indicate the root cause of alert. May be treated as an expression if Alert Message And Trigger Messages Are Expressions option is enabled.
|
message
|
These may be accessed via the eventTriggers variable.
Variable Triggers
Every variable trigger periodically inspects value the variable in every context matching the mask defined by the Context Mask setting. Polling period is defined in seconds, by the Check Period parameter. A Data Table containing the value of the variable is retrieved from the context, and then something happens, according to the value of the Monitor State Changes setting:
This property defines a list of Variable Triggers.
Field Description
|
Field Name
|
Context Mask. This mask is resolved during trigger processing. The value the variable specified by the Variable parameter will be monitored in any context matching the mask. In most cases, this context mask points to one explicit context, being a context path, rather than a mask.
|
mask
|
Variable. Name of context variable to be monitored.
|
variable
|
Expression. AggreGate Expression used to check the variable value. The result of this expression will be processed according of the Monitor State Changes flag.
|
expression
|
Monitor State Changes. It this setting is disabled, the trigger fires whenever the result of Expression changes from FALSE to TRUE. If it's enabled, trigger fires whenever the result of Expression changes (from one value to another, not necessarily TRUE/FALSE). This is comprehensively described above, under variable triggers.
|
monitorStateChange
|
Check Period (seconds). Time interval between inspections of Variable.
|
period
|
Delay (seconds). Time interval between time when trigger expression become true and time when alert is raised.
|
delay
|
Alert Level. Level of this alert event.
|
level
|
Deactivator. Alert deactivation expression.
|
deactivator
|
Deactivation Delay. Alert deactivation delay.
|
deactivationDelay
|
Trigger Message. Usually used to indicate the root cause of alert. May be treated as an expression is Alert Message And Trigger Messages Are Expressions option is enabled.
|
message
|
These may be accessed via the variableTriggers variable.
Alert Notifications
This property defines alert notification rules.
Field Description
|
Field Name
|
Notify owner if connected to the server. Show a popup message to the user owning this alert if he happens to be logged on to a LinkServer User Interfaces (such as AggreGate Client) when the alert is raised.
|
notifyOwner
|
Acknowledgement is required. Force user to acknowledge an alert when the alert notification is shown.
|
ackRequired
|
Notification sound. Sound that will be played to the alert owner before notification popup is shown.
|
sound
|
Send e-mail to owner. E-mail the owner, to the address specified in his user profile.
|
mailToOwner
|
E-mail recipients. List of LinkServer users who will receive e-mail notifications of the alert.
|
mailRecipients
|
Additional e-mail recipients. Comma-separated list of e-mails addresses. Alert notification will be sent to each of these addresses.
|
additionalMailRecipients
|
SMS recipients. List of phone numbers to those SMS notification message will be sent upon alert. This list may contain both LinkServer users who have phone numbers in their account settings and raw phone numbers. All numbers must be written in international format.
|
smsRecipients
|
These may be accessed via the notifications variable.
Alert Escalation
This property defines processing options for pending alerts and alert escalation rules.
Field Description
|
Field Name
|
Allow pending alerts. When enabled, allows the alert to switch to "Pending" state. Disabling pending alerts also disables escalation.
|
pending
|
Number-based escalation. Enables escalation due to a certain number of pending alert instances.
|
numberEscalation
|
Number of pending alerts requited to initiate escalation. When the number of pending alert instances (of this type) exceeds this limit, alert is escalated.
|
numberThreshold
|
Time-based escalation. Enables escalation due to alert instances that are pending longer than the specified time limit.
|
timeEscalation
|
Time before escalation (minutes). If any pending alert instances are not acknowledged within this time, alert is escalated.
|
timeThreshold
|
These may be accessed via the escalation variable.
Automatic Corrective Actions
This property defines the actions to be executed in non-interactive mode when the alert is raised. A good example illustrating application of this feature is execution of an external application on alert.
Field Description
|
Field Name
|
Context Mask. Action will be executed from every context matching this mask.
|
mask
|
Action. Name of the action to be executed.
|
action
|
Parameters. This list incudes parameters of two types: action-specific execution parameters and pre-defined input for different UI Procedures like Confirmation, Edit Data etc. Pre-defined input is required to substitute user input when alert executes action in non-interactive mode. For example, if an automatic corrective action requires confirmation (i.e. asks user something like "Delete query?" and allows to click OK or Cancel), this field will contain a "Delete query?" parameter with two possible choices: "OK" and "Cancel".
|
input
|
These may be accessed via the alertActions variable.
interactive Corrective actions
This property defines the actions to be executed in interactive mode when the alert is raised while its owner is connected to the server.
Field Description
|
Field Name
|
Context Mask. Action will be executed from every context matching this mask.
|
mask
|
Action. Name of the action to be executed.
|
action
|
Parameters. Action-specific execution parameters.
|
input
|
These may be accessed via the interactiveActions variable.
Examples
Now that we've covered all the theory, let's see some examples of real-world alert configuration.
IMPACT WARNING ALERT
Let's assume that our hardware device is a forklift controller that may generate Impact event when forklift collides with some obstacle. This event contains Level field that represents impact level, higher levels indicate more severe impacts.
The Impact Warning alert has a single Event Trigger which fires due to the Impact event in the Data Terminal context if the Integer level field in event data is greater than 50 (i.e. alert is raised only for severe impacts) .
Alert Info
Field
|
Value
|
Alert Name
|
impact_warning
|
Alert Description
|
Impact Warning
|
Alert is Enabled
|
TRUE
|
Message
|
Severe impact occurred to the vehicle
|
Triggers Activated by Events
Context Mask
|
Event
|
Filter Expression
|
users.admin.devices.forklift
|
impact
|
{level} > 50
|
Alert Notifications
Field
|
Value
|
Notify owner if connected to the server
|
TRUE
|
Acknowledgement is required
|
FALSE
|
Notification sound
|
<Not set>
|
Send e-mail to owner
|
TRUE
|
E-mail recipients
|
NONE
|
Additional e-mail recipients
|
|
SEVERAL HARDWARE DEVICES IN TROUBLE
This complex example show how integration of two powerful features, alerts and queries, may be helpful to detect error conditions that involve several Device.
Assuming that ten temperature sensors are connected to LinkServer and owned by user john. The Data Terminal context of every sensor has a Temperature variable (variable name: temperature) whose value has an Integer field, celsius, containing the temperature in Celsius. Suppose the temperature of every individual sensor is not critical, but if three or more sensors report temperature greater than 100 degrees this may lead to problems in the future, and an alert should be raised to let the operators know there's a problem.
We'll use a query that helps to find all thermometers reporting temperature over than 100 degrees:
SELECT * FROM users.john.devices.*:temperature WHERE temperature$celsius > 100
This query returns a table (Data Table) containing one record per every sensor showing high temperature.
We can execute the above query by calling the executeQuery function from the Root context and passing the query text to it as an input parameter. So the idea is to set up an alert with a trigger that periodically executes this query and checks the number of records in its output. If the number is greater than three, the trigger fires.
Variable triggers may not be used to check function output directly, but here we must check a function's output -- executeQuery is a function. As covered above, alerts can be triggered in two ways -- when an event (so-called "event triggers") happens, or according to the value of some variable ("variable trigger"). For our example, we'll use a "variable" trigger, but we'll hack it a little bit. A variable trigger always has a context, a variable and an expression. Now, expressions can actually invoke functions.
So we're going to create an alert which has a meaningless context, a meaningless variable (which is still valid for that context), and a very meaningful expression. This expression won't even refer to the context and variable of the alert. We care only about the expression in this case, because it causes the query to be executed for us. The other parts (context and variable) are just placeholders. As placeholders, we'll use the "" (root) context and the version read-only variable, containing the server version.
Out alert will be raised when the expression evaluates to true.
To access the number of records contained in the output of the executeQuery function we will use the records property (see References for details about the reference resolving process). So, the final reference that will return the number of thermometers registering a high temperature looks like this:
{:executeQuery("SELECT * FROM users.john.devices.*:temperature WHERE temperature$celsius > 100")#records}
How it works:
| 1. | The trigger periodically polls the Root context for the value of the version variable. |
| 2. | This value is discarded as it is not used in trigger expression. |
| 3. | The expression is evaluated. During evaluation, Default Reference Resolver resolves the above reference - it calls the "Execute Query" function and returns the number of rows in the result. This number is compared to the numeric constant "3". The resulting expression returns TRUE if it is greater or equal to it and FALSE otherwise. |
| 4. | If the expression returns TRUE, the trigger raises the alert and all notifications are sent. |
Alert Info
Field
|
Value
|
Alert Name
|
temperature_warning
|
Alert Description
|
Temperature Warning
|
Alert is Enabled
|
TRUE
|
Message
|
Three or more sensors show high temperature
|
Variable Triggers
Context Mask
|
Variable
|
Expression
|
Monitor State Changes
|
Check Period (seconds)
|
Level
|
"" (empty string - Root context)
|
version
|
{:executeQuery("SELECT * FROM users.john.deviceservers.sensors.devices.*:temperature WHERE temperature$celsius > 100")#records} >= 3
|
FALSE
|
10
|
Error
|
Alert Notifications
Field
|
Value
|
Notify owner if connected to the server
|
TRUE
|
Acknowledgement is required
|
FALSE
|
Notification sound
|
<Not set>
|
Send e-mail to owner
|
TRUE
|
E-mail recipients
|
NONE
|
Additional e-mail recipients
|
|

|
Additional examples may be found in the Triggers section.
|
|