Introduction
One of the features of SensorSDK is the ability to be programmed so it can send emails and display information on the main site when certain things goes wrong like for example temperature in your fridge going over -15°C or a sensor node that's not reporting for a long time. This Alert framework inside SensorSDK can be easily configured by the user.
Vocabulary
- Alert Definition: a set of rules used to determine if a certain alert should be risen or not.
- Alert Definition Template: a set of templates used for creating email content when reporting a new alert.
- Alert: a certain alert that was triggered at a certain moment based on a certain Alert Definition.
- Alert timeout: on certain events you want to make sure you get more than one email when something goes wrong, this is what the timeout on a Alert Definition is used for. If after timeout seconds since the alert was originally created the monitored variable is still at the alert condition then it will triggered again.
Types of Alerts
There are basically four kinds of alerts available as of February 2010
Alert Definition Creation
Through the SensorSDK Admin Site you can reach the Alert Definition creation and editing page.
++Steps needed for creating an Alert Definition:
- Select the type of alert you're defining from the drop-down box.
- Choose field to monitor, field names are going to be generated based on the available plug-ins your system have.
- Define set point based on the kind of alert you're using.
- Define clear point based on the kind of alert you're using.
- Define the observed nodes from the list.
- Choose users that will get notified when this alert gets raise.
- Finally you can mark your alarm as either enabled or disabled. And setup a timeout value.
Clearing Alerts
Alerts can be cleared under three different circumstances:
- A user mark the alert as fixed.
- The monitored variable gets back into normal values.
- The alert reaches the timeout value.
Only the first case is not handled automatically, all the other cases are going to be handled by the SensorSDK Alerts framework
When an alert is triggered the selected users will get a notification like for example
[SensorSDK Notifications] [SensorSDK - Alerts] Stairs[00:50:C2:7F:42:78]: is not reporting
This is an automatically generated message, don't try replying to it.
Stairs[00:50:C2:7F:42:78] hasn't reported for the last 600.0 seconds.
Please check what's wrong. This alert will be sent again in 100 seconds if not cleared first.
Regards,
SensorSDK Automatic alerts
And the initial screen well get updated too when you are logged-in:
Alert Definition Templates
When ever an email is generated for an Alert the corresponding text of the email is creating according to a user defined template.
From scratch template generation might be a bit complex, so we provided the quick setup system with a way to automatically fill the templates with some basic information, if you need to add more information to your Alert emails then you will have to get some understanding on django template system, you can read more about this at http://docs.djangoproject.com/en/1.1/topics/templates/
[[note]] Alert definition template edition is a bit complex for just one page, so we are not adding it here yet, if you need more information about this please contact us.[[/note]]