Advertisement
Guest User

Health check section

a guest
Jun 7th, 2017
1,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Crontab:
  2. Modify the crontab to execute the resource check script, this can be done by executing ‘sudo crontab -e’ & by entering the following in it: */15 * * * * cd ~/git/Scripting && ./healthcheck.sh >/dev/null 2>&1
  3.  
  4. This will execute the health check script every 15 minutes. E-mails can be configured within the settings file of the health check script, be aware that this does require ssmtp (or postfix) & mailutils to be installed & configured. Add recipient e-mail addresses in the email config file(s).
  5.  
  6. Setting up mailutils & ssmtp:
  7.  
  8. Install mailutils & ssmtp with: ‘sudo apt(-get) install mailutils ssmtp’ after that configure ssmtp, execute ‘sudo nano /etc/ssmtp/ssmtp.conf’ , this is an example configuration:
  9.  
  10. root=<username>@gmail.com
  11. mailhub=smtp.gmail.com:587
  12. AuthUser=<username>
  13. AuthPass=<password>
  14. UseSTARTTLS=YES
  15.  
  16. Test it by executing ‘echo “test message” | mail -s “test subject” “recipient@mail.com”’.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement