FreeNAS-scripts icon indicating copy to clipboard operation
FreeNAS-scripts copied to clipboard

Truenas scale ElectricEel-24.10.1 compatibility

Open gpz1100 opened this issue 1 year ago • 2 comments

Been using smart_report.sh for a number of year including up to 24.04.2 (dragonfish). As of build 24.10.10 (electric eel), sendmail has been depreciated.

To work around, there's another project - https://github.com/oxyde1989/standalone-tn-send-email, which is a wrapper of sorts for truenas's built in email function.

To use this project, the only change I had to make to smart_report.sh was replace the sendmail line at the bottom of the script with

python3 sendmail.py --subject "SMART Status Report for ${freenashost}" --to_address ${email} --mail_body_html $logfile > /dev/null 2>&1

This assumes the python script from above is in the same directory as smart_report.sh.

gpz1100 avatar Jan 12 '25 22:01 gpz1100

Thank you! I will look into this.

Spearfoot avatar Jan 12 '25 23:01 Spearfoot

@gpz1100 @Spearfoot thanks to your clear instructions and well documented script, even I was able to get this working for me (TrueNAS ElectricEel-24.10.2.1).

In case it assists anyone else as easily muddled as me, here are some additional (probably unnecessary) notes:

1 - note that the original script says

### Send report ###
if [ -z "${email}" ]; then
  echo "No email address specified, information available in ${logfile}"
else
 sendmail -t -oi < ${logfile}
fi

which needs to be changed to say

### Send report ###
if [ -z "${email}" ]; then
  echo "No email address specified, information available in ${logfile}"
else
python3 mr_sendemail.py --subject "UPS Status Report for ${freenashost}" --to_address ${email} --mail_body_html $logf>
  rm ${logfile}
fi

and the various recent updates due to @oxyde1989 (mentioned above) means the local python script is now called mr_sendemail.py and not sendmail.py

ElectronicBattle avatar Apr 13 '25 09:04 ElectronicBattle