Alertinator API Docs

class AlertinatorException

The base exception class Alertinator uses.

Derived exceptions are used to trigger an alert. The only requirement is that they must have a class constant bitmask, which will be ORed together with each alertee’s notify levels to determine whether a particular alerting method will be used.

class AlertinatorNoticeException
AlertinatorNoticeException:: bitmask = Alertinator::NOTICE;
class AlertinatorWarningException
AlertinatorWarningException:: bitmask = Alertinator::WARNING;
class AlertinatorCriticalException
AlertinatorCriticalException:: bitmask = Alertinator::CRITICAL;
class Alertinator
Alertinator:: NOTICE = 1;
Alertinator:: WARNING = 2;
Alertinator:: CRITICAL = 4;
Alertinator:: ALL = 7;
property $twilio
property $checks
property $groups
property $alertees
property $emailSubject
property $_twilio
__construct()
check()

Run through every check, alerting the appropriate alertees on check failure.

Raises Exception:
 Rethrows any non-expected Exceptions thrown in the checks.
alertGroups()
extractAlertees()
Parameters:
  • $alerteeGroups (iterable) – An iterable of strings corresponding to group names in $this->groups.
Returns:

An iterable of strings corresponding to alertee names in $this->alertees.

alert()

Alert an alertee.

Parameters:
  • $exception (AlertinatorException) – The exception containing information about the alert.
  • $alertee (array) – An array describing an alertee in the format of $this->alertees.
email()

Send an email to $address with $message as the body.

sms()

Send an SMS of $message through Twilio to $number.

call()

Make a phone call through Twilio to $number, with text-to-speech of $message.

getTwilioSms()

Return an object capable of sending Twilio SMS messages.

This function exists partly to ease mocking, and partly to abstract away Twilio’s deep object inheritance.

getTwilioCall()

Return an object capable of making Twilio calls.

This function exists partly to ease mocking, and partly to abstract away Twilio’s deep object inheritance.

getTwilio()

Return a configured Services_Twilio object.

Previous topic

User Guide

Next topic

Contributor Guide