Skip to content

Instantly share code, notes, and snippets.

@ffjia
Forked from matetsu/redis-notify.sh
Created March 16, 2016 02:55
Show Gist options
  • Save ffjia/e80d5d8dce5e3c5918c2 to your computer and use it in GitHub Desktop.
Save ffjia/e80d5d8dce5e3c5918c2 to your computer and use it in GitHub Desktop.
#!/bin/sh
# redis-notify.sh
MAIL_FROM="notify@example.net"
MAIL_TO="alert@example.net"
if [ "$#" = "2" ]; then
mail_subject="Redis Notification"
mail_body=`cat << EOB
============================================
Redis Notification Script called by Sentinel
============================================
Event Type: ${1}
Event Description: ${2}
Check the redis status.
EOB`
echo "${mail_body}" | mail -r "${MAIL_FROM}" -s "${mail_subject}" "${MAIL_TO}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment