Defining alerters
Alerters send one-off alerts when a monitor fails. They can also send an alert when it succeeds again.
An alerter knows if it is urgent or not; If a monitor defined as non-urgent fails, an urgent alerter will not trigger for it. This means you can avoid receiving SMS alerts for things which don’t require your immediate attention.
The types of alerter are:
- email: Sends an email when a monitor fails. Sends an email when it succeeds again. Requires an SMTP server to talk to. Non-urgent (all monitors will trigger this alerter.)
- bulksms: Sends an SMS alert when a monitor fails. Does not send an alert for when it succeeds again. Uses the BulkSMS service, which requires subscription. The messages are sent over HTTP on port 5567. (Urgent, so
urgent=0monitors will not trigger an SMS.) - syslog: Writes an entry to the syslog when something fails or succeeds. Not supported on Windows.
Defining an alerter
The section name should be the name of your alerter. This is the name you should give in the “alerters” setting in the reporting section of the main configuration. All alerters share these settings:
- type is the type of alerter. You can choose from
emailto send mail, orbulksmsto send SMS alerts using the BulkSMS service, orsyslogfor the syslog alerter. Required; no default. - depend is a list of monitors this alerter depends on. If any of them fail, no attempt will be made to send the alert. (For example, there’s no point trying to send an email alert to an external address if your route(s) to the Internet are down.) Optional; no default.
- limit is the number of times a monitor must fail before this alerter will fire. This number uses the virtual fail count, so if a monitor has a tolerance of 3 and an alerter has a limit of 2, the monitor must fail 5 times before an alert is sent. You can use this to escalate an alert to another email address if the problem is ongoing for too long, for example. Optional; default=1.
- dry_run will make an alerter do everything except actually send the message. Instead it will print some information about what it would do. Use when you want to test your configuration without generating emails/SMSes. Set to 1 to enable. Optional; default=0.
Time periods
All alerters accept time period configuration. By default, an alerter is active at all times, so you will always immediately receive an alert at the point where a monitor has failed enough (more times than the limit). To set limits on when an alerter can send:
- day: Which days an alerter can operate on. This is a comma-separated list of integers. 0 is Monday and 6 is Sunday. Optional, default is all days.
- times_type: Set to one of
always,only, ornot. “Only” means that the limits define the period that an alerter can operate. “Not” means that the limits define the period during which it will not operate. Optional, default: always. - time_lower and time_upper: If
times_typeisonlyornot, these two settings define the time limits.time_lowermust always be the lower time. The time format ishh:mmusing 24-hour clock. Both are required iftimes_typeis anything other thanalways. - delay: If any kind of time/day restriction applies, the alerter will notify you of any monitors that failed while they were unable to alert you and are still failed. If a monitor fails and recovers during the restricted period, no catch-up alert is generated. Set to 1 to enable. Optional, default=0.
Here’s a quick example of setting time periods:
Don’t send me SMSes while I’m in the office (8:30am to 5:30pm Mon-Fri):
[out_of_hours] type=bulksms ... times_type=not time_lower=08:30 time_upper=17:30 days=0,1,2,3,4
Don’t send me SMSes at antisocial times, but let me know later if anything broke and didn’t recover:
[nice_alerter] type=bulksms ... times_type=only time_lower=07:30 time_upper=22:00 delay=1
Email alerters
- host is the email server to send the message to (via SMTP). Required; no default.
- from is the email address the email should come from. Required; no default.
- to is the email address to email should go to. Required; no default.
BulkSMS alerters
- sender is who the SMS should appear to be from. Max 11 chars. Try to avoid non alphanumeric characters. Optional; default=SmplMntr.
- username is your BulkSMS username. Required; no default.
- password is your BulkSMS password. Required; no default.
- target is the number to send the SMS to. Prefix the country code but drop the +. UK example: 447777123456. Required; no default.
Syslog alerters
Syslog alerters have no additional options.
Example
See the Configuration page for an example configuration.
Add a comment