Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR=/tmp/errorlog
- RECIP=$(cat /root/bin/emailrec)
- echo Hi, this email to inform you of any potential issues with the server.bla qmail mail server > /tmp/demail
- grep pls /var/log/qmailcheck.log > /tmp/errorlog
- if [ ! -s $ERROR ] ; then
- echo There are no errors in the qmailcheck log file >> /tmp/demail
- echo Here are the last 10 lines of the current qmailcheck log file: >> /tmp/demail
- tail /var/log/qmailcheck.log >> /tmp/demail
- else
- echo The log file for the qmail check script contains the following errors: >> /tmp/demail
- cat $ERROR >> /tmp/demail
- echo You should have also received an email which will better explain the error >> /tmp/demail
- echo Check the time of the error above to determine when the email was sent >> /tmp/demail
- fi
- MAIL=$(/var/qmail/bin/qmail-qstat | grep "queue:" | awk '{ print $4 }')
- echo There are $MAIL messages in the mail queue >> /tmp/demail
- echo File system usage is currently at `df -h |grep vzfs | awk '{ print $5}'` >> /tmp/demail
- cat /tmp/demail | mail -s "Daily server report from server.bla" $RECIP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement