Skip to content

Instantly share code, notes, and snippets.

@matetsu
Created January 15, 2013 15:03
Show Gist options
  • Save matetsu/4539241 to your computer and use it in GitHub Desktop.
Save matetsu/4539241 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