dak180 / FreeNAS-Report

SMART & ZPool Status Report for FreeNAS/TrueNAS
GNU General Public License v3.0
38 stars 8 forks source link

Fix for upsc creating an extra error email | upsc Init SSL without certificate database #26

Closed bobatgit closed 10 months ago

bobatgit commented 10 months ago

So, I just added the script on a fres TrueNas install (TrueNAS-SCALE-22.12.3.3) and activated UPS reporting. Everything works great and I receive the email reports as expected.

Except, I started getting a new extra error email with the following error "Init SSL without certificate database". Upon digging further I narrowed this down to upsc. It seem it needs some credentials to be setup which are not active by default. See below research:

The fix for upsc seems unclear. Hoever, I managed to find an alternative to suppress the error. I narrowed down the error to this line: https://github.com/dak180/FreeNAS-Report/blob/bc84a5553410f8c048c80403fa6865501fb4b4cf/report.sh#L2131

I applied the following changes to supress the error (essentially send the error to /dev/null) readarray -t "upslist" <<< "$(upsc -l "${host}" > /dev/stdout 2> /dev/null)"

Hope this helps more folks get rid of the same issue!

(PS. Happy to provide info for debugging)