A simple script to send Monit alerts to you via SMS with Twilio.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
monit-example.conf
monit2twilio.sh
playbook.yml
twilio-sms.sh
twiliorc

README.md

Monit2Twilio

A simple script to send Monit alerts to you via SMS with Twilio.

Monit only sends alert notifications via email out of the box, but also provides a hook to execute a script. When executing the script, Monit sets a few environment variables about the alert.

This tiny script transforms those variables into a text message and pipes them to Twilio's twilio-sms bash script for delivery.

Usage

Put your Twilio credentials in twiliorc and upload it to the user's home directory (probably root, since Monit runs as root).

Upload twilio-sms and monit2twilio to /usr/local/bin and make them executable (e.g. 0755).

Then, wire up any Monit alerts that you'd like:

check file nginx.pid with path /var/run/nginx.pid
  if changed timestamp then exec "/usr/local/bin/monit2twilio" as uid root and gid root

There's also an Ansible playbook if you're so inclined.

Delightful!