Advertisement
Guest User

Untitled

a guest
Sep 14th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ip_address="1.2.3.4"
  4. from_user="monitoring@foobar.com"
  5. to_user="user@foobar.com"
  6. smtp_host="mail.foobar.com"
  7. smtp_user="monitoring@foobar.com"
  8. smtp_password="foobar"
  9.  
  10. df -h | grep -E "(Filesystem|sda)" | mail -S smtp-auth-user=${smtp_user} -S smtp-auth-password=${smtp_password} -S smtp=${smtp_host} -s "[LOG] ${ip_address} Disk Usage Report $(date +\%y/\%m/\%d)" -r ${from_user} -c ${to_user} ${to_user}
  11.  
  12. # cat msg | mail -b "bcc_user@foobar.com" -s "Email" "user@foobar.com"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement