Home / Resources / How To: Setup FactorySQL Alert Distribution Lists

How To: Setup FactorySQL Alert Distribution Lists

This article demonstrates how to setup email alert distribution lists in FactorySQL. For this example, we will show how to setup a severity based list, a group based list and a shift based list.

Background

Alert Distribution lists allow you to define Groups and Contacts, and rules that define when contacts receive various alerts.

A group has an expression that defines which alert it will receive. Whenever an alert occurs that passes the group's expression, an email is sent to all contacts who belong to that group. The expression is the same as an action item expression, and can use all of the functions and operators available to them. Unlike action items, the distribution group expression can refer to the properties of an alert, such as its Value, Time, Severity, Group Name, etc.

A contact consists of a name and email address, and a list of groups that they belong to. Note: only one email will be sent to each contact per alert, therefore it is OK to have contacts that are members of groups whose expressions may overlap.

Getting Started

First, we need turn on alerting in FactorySQL. Open up the FactorySQL frontend and select Settings -> Alert Settings. Once there select a Log connection, which will be the database FactorySQL uses to store alerts. Next, give FactorySQL two table names, a log table and a status table. Make sure the System Behavior is set to Standard. Lastly, click the checkbox Send an email to the following addresses when an alert occurs and fill out the bottom portion giving the Mail Server, Port, etc. Once you are done hit OK. FactorySQL will automatically create the log table and status table in your database.

Here is an example:



Next, select Distribution Lists under Alert Settings on the left. Again, tell FactorySQL what database you want to store the groups and contacts in by selecting the connection under Data Connection. Now we are ready to start configuring our lists.

Here is an example:



To learn how to setup individual alerts please consult the FactorySQL user manual.

Severity Based List

In the Alert Distribution Lists section add a new group and call it Severity Group. Now, we need to write an expression that deals with an alert's severity. For this group, let's send out emails when the severity is Medium which translates to a value of 2.

Translations:
Low = 0
Low-Medium = 1
Medium = 2
Medium-High = 3
High = 4

This is what the expression will look like:
{[SEVERITY]} = 2

Enter this code into the expression and save the group. The group will look like this:



That's it! Now when an alert occurs and its severity is Medium an email will be sent out to all of the contacts in the Severity Group.

Group Based List

In the Alert Distribution Lists section add a new group and call it Group. Now, we need to write an expression that deals with an alert's group name. For this group, let's send out emails when the group name is "Test Group".

This is what the expression will look like:
{[GROUP_NAME]} = "Test Group"

Enter this code into the expression and save the group. The group will look like this:



That's it! Now when an alert occurs and it is inside the group "Test Group" an email will be sent out to all of the contacts in the Group.

Shift Based List

In the Alert Distribution Lists section add a new group and call it Shift Group. Now, we need to write an expression that deals with an alert's time. For this group, let's send out emails to a shift that runs from 8:00 AM to 1:00 PM.

This is what the expression will look like:
TimeBetween({[TIME]}, "8:00 am", "1:00 pm")

Enter this code into the expression and save the group. The group will look like this:



That's it! Now when an alert occurs and its time is between 8:00 AM and 1:00 PM an email will be sent out to all of the contacts in the Group.

More Information

Please consult the FactorySQL user manual for more information on the properties available to expressions. Also, you can combine groups above into a single group using the && operator in the expression. So, you could have an expression like this:

{[GROUP_NAME]} = "Test Group" && {[SEVERITY]} = 2

Here an email will be sent out when the alert's group name is Test Group and the severity is medium.

If you want to configure the alert distribution lists inside of the FactoryPMI look at the Alert Distribution lists goodie located here.
published: 04/30/14