Resource icon

multi_report.sh version for Core and Scale 3.0

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Thank you! I really appreciate it! Would be cleaver as well to write it clearly in the docs!
The fix is done, the proper files are backed up now and the documentation has been updated to include the data. I've also included encrypting the file when emailing it as a security measure. While from what I understand it should not be required, it's best to include it and if a person feels like using it, it's there.

This will be in version 2.1 and the new User Guide.
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Line 6

Code:
NOTE: Some email providers will not send an encrypted file type, such as GMAIL.


needs a leading comment crunch.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Line 6

Code:
NOTE: Some email providers will not send an encrypted file type, such as GMAIL.


needs a leading comment crunch.
Already saw that this morning and fixed it. I've found two more fixes also, one much more important. This will never end. I will update github in a few minutes and forward you an PM copy since I can see you are testing it out, appreciate that. I still have a few thousand lines to review today. :frown:
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
I sent you an actual debug-report with the latest script you sent me via PM. Thanks a lot for all your effort, Joe!
 

hrayrwannis

Dabbler
Joined
Mar 18, 2023
Messages
11
Thanks a lot for the script. I have been looking around the entire week to get the config file backed up to my email.

your script seems to work the best so far with Tn Scale though so far i have not receive attachements - i am getting the following error:


root@truenas[/mnt/pool_1/backup/scripts]# ./report.sh
Multi-Report v2.0.10 dtd:2023-03-06 (TrueNAS Scale 22.12.1)
Configuration File Version Date: 2023-03-06
./report.sh: line 2859: ( / 8760): syntax error: operand expected (error token is "/ 8760)")

0 minutes and 21 seconds elapsed.
appreciate if you can let me know if i did anything wrong?

thanks.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Thanks a lot for the script. I have been looking around the entire week to get the config file backed up to my email.

your script seems to work the best so far with Tn Scale though so far i have not receive attachements - i am getting the following error:

root@truenas[/mnt/pool_1/backup/scripts]# ./report.sh
Multi-Report v2.0.10 dtd:2023-03-06 (TrueNAS Scale 22.12.1)
Configuration File Version Date: 2023-03-06
./report.sh: line 2859: () / 8760: syntax error: operand expected (error token is ") / 8760")
0 minutes and 20 seconds elapsed.

appreciate if you can let me know if i did anything wrong?

thanks,
Hrayr
I will PM you. I suspect you might have a drive that may not be recognized.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I sent you an actual debug-report with the latest script you sent me via PM. Thanks a lot for all your effort, Joe!
Ended up in the SPAM filter, got it now and Thanks!
 

Deeda

Explorer
Joined
Feb 16, 2021
Messages
65
Was in the middle of sending Joe an email as I thought the script had lost the plot. My daily report emails listed all my drives in red. I thought it would be weird they'd all have issues at the same time. Then it occured to me what the date was :tongue:
 

Attachments

  • Screenshot 2023-04-01 174059.png
    Screenshot 2023-04-01 174059.png
    52.5 KB · Views: 75

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Glad I could bring a little excitement to an otherwise hopefully uneventful day.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
That was cruel, only something Wednesday Addams could think up!
 

TooMuchData

Contributor
Joined
Jan 4, 2015
Messages
188
TooMuchData updated multi_report.sh version for Core and Scale with a new update entry:

Many Improvements by Joe

This version has a user manual. It also saves the prior configuration file before updating it (to allow easier fallback if necessary).

# V2.1 (29 March 2023)
#
# - Updated TrueNAS password backup to include encrypted password file, and enable encrypted Config File in email.
# -- NOTE: The encrypted password is on line #5 of this script.
#
# - Updated script to use 'json' data.
# - Fixed script to allow for a zero hour runtime on a drive.
# - Renamed variables so they make more...

Read the rest of this update entry...
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Works like a charm! Thanks!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Works like a charm! Thanks!
Except for the April Fool's Joke doesn't work :frown: I was hoping to see a message on my machine when I woke up, but nope. I actually didn't test that part and should have, it just wasn't nearly as important as getting the real data correct. The previous version does work as indicated above. But thanks for the kind words.

I'm doing something quite different with this version so if someone notices a problem, please let me know. With some luck, I can reduce the data collection by two thirds on the next version.
 
Last edited:

daschmidt

Explorer
Joined
Feb 12, 2023
Messages
61
what's the easiest way to update the script copy and past the code or is it possible with a script command?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
what's the easiest way to update the script copy and past the code or is it possible with a script command?
I'm not sure I understand the question. The script is self-updating so if you have a version 1.6 or newer, it "should" do all the updating for you.
 

souporman

Explorer
Joined
Feb 3, 2015
Messages
57
JESUS I've never run to my desktop so fast in my life after getting that email this morning!
 
Last edited:

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
I'm not sure I understand the question. The script is self-updating so if you have a version 1.6 or newer, it "should" do all the updating for you.
Wait, what? Are you saying that I don't need to manually overwrite the old script with the new one?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Wait, what? Are you saying that I don't need to manually overwrite the old script with the new one?
Huh? Yes, you need to replace the old script with the new one, or change the CRON job to reference the new procedure. The multi_report_config.txt will automatically update itself. With the external configuration file you do not have to edit the script itself, unless you want to encrypt the TrueNAS config file in an email. Read the new User Guide. While it made sense to me, if there is something confusing, please let me know.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Huh? Yes, you need to replace the old script with the new one, or change the CRON job to reference the new procedure. The multi_report_config.txt will automatically update itself. With the external configuration file you do not have to edit the script itself, unless you want to encrypt the TrueNAS config file in an email. Read the new User Guide. While it made sense to me, if there is something confusing, please let me know.
Oh I misinterpreted your relpy then.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
SCALE Users -- Please note that 7-Zip will be installed on your system to support TrueNAS configuration file encryption. Unfortunately as it normally happens, I think about what I've done and have incorporated another change to Only install 7-Zip IF the user desires encryption. The next update will have this. And I will update the User Guide to support this change.

Wait, what? Are you saying that I don't need to manually overwrite the old script with the new one?
That isn't a bad idea and I am almost positive I could make that happen, if users would desire something like that. I do post to GitHub. I could make the script check for a newer file. It would make distributing updates/bug fixes quicker. Eh, let me know but it will take some time as I would need to test, retest, and test once again before I put something like that on the streets. It would also be optional and the default is disabled.
 
Top