Outdated Resource Warning!
This is documentation for
legacy version 0.x releases. If you are using 1.x see the
wiki.
Alerts and Alert Actions
When a node on which "alerts active" is set fails a test (or generates a warning) an alert is created. This alert is displayed in a box to the right of all FreeNATS pages.
If a node has a current alert this is also shown in the node status display where you can also view the history of that and any previous alerts.
Alert actions are actions to perform when an alert is generated. Currently only email and URL actions are supported. Actions are created and modified in the administrator page (under Alert Actions).
For each alert action you can specify a name, a type (email, url or disabled) and select whether to include warnings and decreases.
You can also set the action limit (and view/update the action counter). The action limit is the number of times in a calendar
day the alert action can be called before it just ignores input (and logs what has happened). Setting this to zero means
unlimited. The counter shows the count and the last day on which the count was updated (the next time the alert action is called on a
different day it will reset the counter). For debug purposes you can change the counter in here manually. Action tests are counted.
If warnings are not included only outright failure alerts are reported by this alert action. If decreases are selected then further alerts are sent when the alert decreases from failed to warning (not if warnings is not checked) or is closed (the test has passed).
For email alerts you can specify a from address, subject and type format as well as a list of recipients (one on each line of the email to box without commas or any other punctuation). Long format subjects include some extra details.
For URL alerts you enter each URL you wish called on each line of the URL box. This should be a fully-qualified URL (include http). The message is URL encoded onto the end. So you can for example put something like "http://somehost/script.php?action=freenats&message=" and that script will be called with the message URL encoded into the message parameter.
The long message type includes some padding and other information around the alert text wheras short just sends the absolute minimum alert text (useful for email/URL to SMS messages).
Selecting test action will do just that and fire off test alerts to everyone/every URL on the list.
Nodes are assigned to and removed from alert actions in the node edit page and can be a member of any number of alert actions.
In this way for example it is possible to have all node alerts emailed to a normal email address but only alerts on one or two critical nodes also sent via email to SMS.
A Note About Threaded Testing
Very early versions of FreeNATS relied entirely on the tester.sh script which tests one or all nodes in series (one after the other). For a variety of reasons threading is a much better solution (where the test-threaded.sh script spawns background processes of tester.sh for every node to be tested at the same time).
The tester.sh script flushes the alert queues when it finishes. In a single run of tester this means the alert queues contain new information for all nodes by the time tester finished resulting in a single email (for each alert action).
In the threaded model the tester.sh script finishes the single node it has been called for, alerts as required and flushes the alert queue. This results in a single email for each node that is handled by an alert action.
Possible steps are afoot to consider a workaround for this if required.