Multi-Report

@Vitosi4ek Did you read the Quick Start Guide? It tells you the CRON settings.

I’m not going to say this will solve everyone’s issues with the released version but it did for me.

Success! Though not without some issues and warts and a little troubleshooting the no emails being sent.
Short Version:
• Login to ssh
• Change to root
• Run multi_report.sh -config
• select (U)pdate
• if the update faults with an error indicating a corrupt file download, then remove any beta.txt versions of the script and the corresponding config file from the directory, but leave the current multi_sript and config file even if it is the renamed beta version This is probably just a bug in the script.
• At this point run the update again and it will download the new files without error.

If the script is attempted to run at this point it will run but fail to send an email, though it wil say it is successful. Inspetion of the output in the ssh session will show:
cat: /mnt/Pool1/my-dir1/scripts/mr_sendemail.py: No such file or directory
3. Sendemail - Installed: , GitHub: 0.09
No Update
NO UPDATES AVAILABLE
The update will not for some reason download and install the mr_sendmail.py script into the directory.

  • So, you now need to run the multi_report.sh -update_sendemail in order to download and install the mr_sendmail.py script into the multi_report directory.
  • Enter ‘y’ to commit or any other key to abort. so enter y like asked and the script will finish the install of the sendmail.

Now when the multi_report script is run you should get an email with the report. If the email is the same as the one currently configured for Truenas and Truenas alerts and you get those email the script should now work.

I didn’t understand/remember you were using that address, as said before

So, unlucky, is nothing i can do about. Gmail api will always overwrite the sender, if Is not a verified alias (you need to add It into your account), or an alias generated with the + (like you do with the recipient ). But at least not throwhing error!
In fact for SMTP, instead, to avoid rejecting and errors only the values verified in mail.config will be used

Okay, guess I misunderstood (too). It’s no problem.
Maybe I’ll think up an alias. Thanks for checking though.

1 Like

I will work on fixing the automatic updates, however I don’t want to change anything more until after we can solve why some scripts are failing, but I will work on these.

If you are migrating from CORE to SCALE, read the Quickstart Use Guide downloaded into your script directory. If this is a first time, read the QuickStart User Guide. If you want the script to test the drives, read the Drive Selftest User Guide. If you think the script is running but you can’t figure out how to get testing working, drop me a message if the User Guide does not help. I would like feedback on the User Guide as well, preferably with recommended changes.

This is because the chsum value was not correct for an upgrade from 3.07. I will have that fixed in less than 5 minutes.

That happened because of an earlier version did not update properly. I hope the version you have now does work properly. You will know when 3.13 comes out, hopefully in a week.

Yes, I remember the error said it was a bad checksum or it didn’t match. I only realized I had deleted the reference to the error sh couldn’t post it. Both production servers are now running the script from ssh as well as from cron. Good work to everyone involved in the fix!

1 Like

Just to add my experience, all working as expected.

1 Like

I’ve done something wrong. I get an error which says

"line 12: syntax error near etc. etc.

(please see below for full details).

A day or so ago I noticed the “0 byte” file size problem after I did a .multi_report.sh -update so, following this thread, I did a manual copy from github to the directory so that I see this when I do ls

root@truenas[/mnt/mainraid/scripts]# ll
total 9410
drwxrwxrwx  4 root        22 Jan 20 00:18 ./
drwxrwxrwx 18 apps        21 Nov 19 17:14 ../
drwxr-xr-x  2 root         3 Jan 17 23:06 DS_Logs/
-rw-r--r--  1 root   4598554 Jan 17 23:06 Drive_Selftest_User_Guide.pdf
-rw-r--r--  1 nobody 1980592 Jul 19  2024 Multi-Report_Quick_Start_Guide.pdf
-rw-r--r--  1 root   1420682 Jul 25 09:49 Multi-Report_User_Guide.pdf
-rw-r--r--  1 root        14 Jan 17 23:40 Multi_Report_Quick_Start_Guide.pdf
-rw-r--r--  1 root   1420682 Jan 17 23:40 Multi_Report_User_Guide.pdf
-rw-r--r--  1 root      8891 Jan 17 23:40 changelog.txt
-rw-r--r--  1 root     84959 Jan 17 23:06 drive_selftest.sh
-rw-r--r--  1 root     15232 Jan 17 23:05 mr_sendemail.py
-rwxr-xr-x  1 root     20003 Jan 20 00:14 multi_report.sh*
-rwxr-xr-x  1 root     20003 Jan 20 00:15 multi_report2.sh*
-rw-r--r--  1 root     26178 Jan 17 23:05 multi_report_config.txt
-rwxr-xr-x  1 root    475562 Jan 17 23:03 multi_report_v3.0.7_2024_06_08.txt*
-rw-r--r--  1 root     23059 Jan 17 23:03 multi_report_v3.0.7_2024_06_08_config.txt
-rwxr-xr-x  1 root    547320 Jan 17 23:40 multi_report_v3.1_2025_01_17.txt*
-rw-r--r--  1 root     26178 Jan 17 23:40 multi_report_v3.1_2025_01_17_config.txt
drwxr-xr-x  2 root         3 Jan 17 23:06 sendemail_log/
-rwxr-xr-x  1 root     10128 Jul 19  2024 smr-check.sh*
-rw-r--r--  1 root     24200 Jan 17 23:06 statisticalsmartdata.csv
-rwxr-xr-x  1 root      3077 Jul 31 15:33 upsreport.sh*

when I then try to run it (having done chmod +x) I see this:

root@truenas[/mnt/mainraid/scripts]# ./multi_report.sh 
./multi_report.sh: line 12: syntax error near unexpected token `('
./multi_report.sh: line 12: `Config_File_Name="$SCRIPT_DIR/multi_report_config.txt" set -E -o functrace failure(){'
root@truenas[/mnt/mainraid/scripts]# 

This is using ElectricEel-24.10.1

Also - from my point of view this is not an urgent problem to solve, so please don’t divert anyone’s effort from the main body of work. It is likely - very likely - that I have done something stupid or forgotten to do something sensible.

“The built-in updater simply downloaded an empty file (0KB)”

That just happened to me as well. Update downloaded an empty file

Was that with version 3.12? There was a problem I thought I addressed in the earlier versions where it was creating an empty file.

You are using a failed version of Multi-Report.

Line 12 should read SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) and has been in Multi-Report for years. This is the first time I have seen this failure message, interesting.

Please visit the GitHub site and grab version 3.12. (it is dated 19 Jan 2025).

Please let me know if that fixes or fails to fix the problem. Your multi_report_config.txt file should still be fine so you can retain that.

Once you have the new version, run it using the -update_sendemail to grab the most current sendemail script and -update_selftest to grab the most recent Drive_Selftest script (it should be current but better safe since it is only a single extra step)

Thanks, I needed that.

2 Likes

Success!

Looks like it is idiot proof after all. Thanks Joe!

Workin’ fine over here, too. Thanks, Joe!

1 Like

Yes and no. You still have the test types set to ‘3’. Which means nothing gets tested by the script.

Hi @joeschmuck and everyone here!

Thank you very much for your time! I have a small problem with the script and its -delete switch.

When version 3.1 was released, I have changed the name of the file using the related -config option. The full path for the new statistical file is /mnt/Volume1/scripts/Multi_Report/Statistics/Statistical-SMART-data.csv.

Today I decided to start over the file, but when I run ./multi_report.sh -delete , it goes to, what I assume, it is the default path instead of the custom one and, as a result, the statistical file is not deleted:

➜ sudo ./multi_report.sh -delete                                                                                                                                                                          12:39:08
[sudo] password for **REDACTED**:
TrueNAS does not support sendmail function, using sendemail.py to send you your email.
Multi-Report v3.12 dtd:2025-01-19 (TrueNAS Scale 24.10.1)
Preparing to Delete Statistical Data File

Press Enter/Return to Continue or CTRL-C to Abort Script
rm: cannot remove '/mnt/Volume1/scripts/Multi_Report/statisticalsmartdata.csv': No such file or directory

File Obliterated !!!

For your consideration:

  • The file, Statistical-SMART-data.csv does exist at the above mentioned path.
  • The script writes to Statistical-SMART-data.csv without problems. It has data of the past days.
  • I run the script using sudo and at the folder it is stored.
  • The file can be normally deleted using a smb share.
  • ls -lah output is as follows:
total 34K
drwxrwx--- 2 root root    4 Jan 20 12:14 .
drwxrwx--- 5 root root   22 Jan 20 12:09 ..
-rwxrwx--- 1 root root 2.0K Jan 19 16:00 Statistical-SMART-data.csv
-rwxrwx--- 1 root root 2.0K Jan 19 16:00 Statistical-SMART-data_duplicado.csv

If you need a dump or something else for checking it, just let me know!

I don’t know - sorry

Just wanted to send a short note to say that v3.12 is working on my system after a clean setup. Thank you for all your hard work!

1 Like