mbrunelli87
Explorer
- Joined
- Sep 17, 2016
- Messages
- 65
Hey guys,
I followed this incredible guide to set up SMART and Scrub processes and I wanted to add an email report to them.
To send email reports, the guide tells me to do that:
I tried to do everything as given in the guide, but when I hit "run now" to test it, it does not send me any email. Things I am not sure I did correctly are:
Thanks!
I followed this incredible guide to set up SMART and Scrub processes and I wanted to add an email report to them.
To send email reports, the guide tells me to do that:
Schedule automatic email status reports/backups. [Updated 8/17/17] This will run a simple script to generate an email report of the scrub and SMART test results. The script I’m using is combined, condensed, and generally improved version of several scripts posted on the FreeNAS forums (my version of the script is posted and discussed towards the end of this thread). The biggest improvement I've made to this script is converting the ZPool and SMART summary data tables from ASCII to HTML. I've also added some other features, like the ability to save each version of the config backup, automatic detection of drives and pools, and color coding in the table that highlights potential issues. I based my script off the SATA version of the script in the above thread, people have reported it works for SAS drives, too. After wrestling with MIME formatting for seemingly endless hours, I've also managed to combine the report email and the config backup email into a single message. Instructions below include a github that will have the most recent version of the script and a basic changelog.
- Get the script from here [.sh file] and put it somewhere on your server; I recommend somewhere in your primary login’s home folder. Use chmod to ensure root has permission to execute the report.sh file.
- Modify the parameters section at the top, most importantly the email address you created above (examples are in the script; remove the <>'s in your script):
email="<the gmail address you set up earlier>"
...
includeSSD="<true/false>"
...
configBackup="<true/false>"
- In the FreeNAS web UI, go to Tasks > Cron Jobs and click “Add Cron Job”. Set the user to “root”, put the full path to the script in the command box, and schedule the report so it runs right after your SMART tests and scrubs occur. My cron settings look like this.
I tried to do everything as given in the guide, but when I hit "run now" to test it, it does not send me any email. Things I am not sure I did correctly are:
- Email address (do I have to put the freenas email address, not the one to which the process is supposed to send the report, right? - Anyway I tried both of them and it doesn't work)
- The part of the guide when he says "Use chmod to ensure root has permission to execute the report.sh file." --> I don't understand what do I have to do
Thanks!