I just ran that exact script, no errors. The only changes I made were my email address and the file location for the statistics to /tmp/. How are you running the script?
My method for testing:
Code:
root@freenas:/mnt/farm2/scripts # ./run_multi_report.sh
Creating statistical datafile
Collecting Drive Information
Running Purging Routine
Sending Email
root@freenas:/mnt/farm2/scripts #
I ran it also as a CRON job, no error messages in the cron log nor the messages log.
All I can think of is you have a scrub message format issue, well to be correct, I may have a formatting issue. Please post the current output from 'zpool status' and then maybe there is something obvious, I hope. I will need to fake the software by entering at line 723 your zpool status data which will be similar to mine below:
Code:
statusOutput="pool: farm2
state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(5) for details.
scan: scrub repaired 0B in 06:10:30 with 0 errors on Sun Mar 6 06:10:30 2022
config:
NAME STATE READ WRITE CKSUM
farm2 ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
gptid/64a06668-d52f-11e7-ab84-0cc47ab37c5a ONLINE 0 0 0
gptid/6528d863-d52f-11e7-ab84-0cc47ab37c5a ONLINE 0 0 0
gptid/65b68ce1-d52f-11e7-ab84-0cc47ab37c5a ONLINE 0 0 0
gptid/66431f30-d52f-11e7-ab84-0cc47ab37c5a ONLINE 0 0 0
errors: No known data errors"
So whatever you give me, if you have multiple pools, I will need to do the testing for all variations. And please use code brackets so the format remains the same.
Cheers,
-Mark