Created
May 29, 2014 22:00
-
-
Save meise/d20397d4db5c7e7b081e to your computer and use it in GitHub Desktop.
Check qmail mesaagequeue status
This file contains hidden or 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/sh | |
MAIL_BIN=`command -v mail` | |
QMAIL_QUEUE_SIZE=`/var/qmail/bin/qmail-qstat | grep 'messages in queue:' | awk '{print $NF}'` | |
function send_notification_mail() { | |
$MAIL_BIN -s "WARNING: MAILQ critical on $HOSTNAME - size $QMAIL_QUEUE_SIZE" "[email protected]" <<EOF | |
Messages in queue: $QMAIL_QUEUE_SIZE | |
EOF | |
} | |
if [ "$QMAIL_QUEUE_SIZE" -gt "100" ]; then | |
send_notification_mail | |
fi | |
exit 0 |
This file contains hidden or 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
*/10 * * * * /usr/local/bin/qstat_cron_check 1> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment