Created
June 25, 2014 23:32
-
-
Save alexdunae/eea65e2a0c2adcc916e6 to your computer and use it in GitHub Desktop.
Get Monit notifications via SMS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Monit EXEC handler that sends monit notifications via SMS | |
# | |
# Depends on having `twilio-sms` installed and a config file in `/root/.twiliorc` | |
# | |
# See also | |
# - https://www.twilio.com/labs/bash/sms | |
# - https://github.com/alexdunae/monit2twilio | |
message="Monit: $MONIT_SERVICE - $MONIT_EVENT at $MONIT_DATE on host '$MONIT_HOST': $MONIT_DESCRIPTION." | |
echo $message | /usr/local/bin/twilio-sms -c /root/.twiliorc {{ monit_twilio_sms }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment