Created
April 19, 2017 23:50
-
-
Save theeye-io/b12c4472f5d8786dedc8dc0231b166ec to your computer and use it in GitHub Desktop.
This Script Monitors Linux mail queue
This file contains 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/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