Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Crontab:
- 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
- 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).
- Setting up mailutils & ssmtp:
- 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:
- root=<username>@gmail.com
- mailhub=smtp.gmail.com:587
- AuthUser=<username>
- AuthPass=<password>
- UseSTARTTLS=YES
- Test it by executing ‘echo “test message” | mail -s “test subject” “recipient@mail.com”’.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement