Pushover makes it easy to get real-time notifications on your Android, iPhone, iPad, and Desktop (Android Wear and Apple Watch, too!)
You can use this shell function anywhere in your script.
Example:
#!/bin/bash pushmail() { APP_TOKEN='auznj8jnj9v7gyuf5qqexx3vyn' USER_TOKEN='uest9vme9gthgpk5f5hmeas59' TITLE='nagios-alerts' MESSAGE="$1" curl 'https://api.pushover.net/1/messages.json' -X POST -d "token=$APP_TOKEN&user=$USER_TOKEN&message=\"$MESSAGE\"&title=\"$TITLE\"" } # call pushmail "server is down"
Note: you need to update API tokens and title above