Skip to content

Instantly share code, notes, and snippets.

@theeye-io
Created April 19, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theeye-io/b12c4472f5d8786dedc8dc0231b166ec to your computer and use it in GitHub Desktop.
Save theeye-io/b12c4472f5d8786dedc8dc0231b166ec to your computer and use it in GitHub Desktop.
This Script Monitors Linux mail queue
#!/bin/bash
mailq_count=`/usr/bin/mailq | /usr/bin/tail -n1 | /usr/bin/gawk '{print $5}'`
mailq_count=`expr $mailq_count + 0`
echo "Mail count on Server is $mailq_count"
result="normal"
if [ $mailq_count -gt $1 ]; then
result="failure"
fi
echo $result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment