Skip to content

alexdunae/monit2twilio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages