Advertisement
Guest User

Untitled

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