Resource icon

multi_report.sh version for Core and Scale 3.0

joeschmuck

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

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
Not trying to be mean but Nope. The main focus of this script is for hard drive awareness. A separate script would be best made to poll the other requested data. I've been asked to include UPS data. I'm not sure if I will, even though it's an easy thing to add.
In software/application architecture there is the concept of "separation of concerns" and this situation is similar. It has long been established that having a given program doing one thing only (and hopefully well), is better than to pack multiple things into it. It confuses users and, through increased complexity by covering multiple "domains" (not in the AD sense, but in terms of knowledge areas), makes maintenance a lot harder.

In total I can only second the approach to keep non-disk related stuff out. Alternatively, one could think about modularization, but that has its challenges with shell scripts.
 

TooMuchData

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

Improvements and fixes galore from joeschmuck

Using "-dump email" when running the script will now send debugging information directly to Joe, including your comments about the problem. Lot's more...

### Changelog:
# V2.0.6 (1 February 2023)
# - Reduced drive data collection. Added 'zpool' data collection.
#
# V2.0.5 (27 January 2023)
# - Adjusted Zpool Status to allow 'resilvering' status message. (Line 1340)
# - Updated '-dump email' command to allow user to enter comments to the author.
#
# V2.0.4 (26 January 2023)
#...

Read the rest of this update entry...
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@TooMuchData You made me laugh with the comment "fixes galore". I'm at work right now and I needed a laugh.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Version 2.0.6 has a slight annoyance bug. You might get a message about "can't find /tmp/zpoollist.txt" and "can't find /tmp/zpoolstatus.txt". These can be ignored and I will hopefully have a fix out today or tomorrow. Unfortunately this is the plight of thinking a person (me) makes a minor change but it makes an unforeseen impact. Again, this is not going to cause any issues with your system and can be safely ignored.

What is happening? Simply put, when the email is generated it is looking for those two files which are only created when running the -dump switch, and you did not use the switch. So it doesn't find the files and continues on smartly.
 

joeschmuck

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

souporman

Explorer
Joined
Feb 3, 2015
Messages
57
I've been using @Bidule0hm's zpool and SMART scripts for years (which have been a total life saver) and only just found this one. I very much appreciate all of the hard work that has gone into this! It's amazing! Thank you, gentlemen! Also, there's a typo in the credits. It says Bidelu0hm, instead of Bidule0hm. Not that it particularly matters...
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Also, there's a typo in the credits. It says Bidelu0hm, instead of Bidule0hm. Not that it particularly matters...
That is funny, never noticed it and I thought he put it in there. But it's changed for the next release. Thanks for pointing it out.
 

IQless

Contributor
Joined
Feb 13, 2017
Messages
142
I have been trying to get this to work, but I think there is something fundamentally I am missing.
Keep getting:
Code:
./multi_report.sh: 296: Bad substitution
./multi_report.sh: 695: [[: not found
./multi_report.sh: 928: Syntax error: redirection unexpected

This is a clean copy of the v2.0.7, and I am getting these errors when I try running it.
Anyone been having the same problem?

Version: Truenas Scale 22.12.0
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I have been trying to get this to work, but I think there is something fundamentally I am missing.
Keep getting:
Code:
./multi_report.sh: 296: Bad substitution
./multi_report.sh: 695: [[: not found
./multi_report.sh: 928: Syntax error: redirection unexpected

This is a clean copy of the v2.0.7, and I am getting these errors when I try running it.
Anyone been having the same problem?

Version: Truenas Scale 22.12.0
I have not tested this script on version 22.12.0, but it does run on 22.12.1. While I doubt that is the issue, please explain in terrible detail how and where you installed the script and how you are running it. The very first failure you have is the location of the script directory. I suspect you placed it somewhere it doesn't like. Where is it located? I place my script in a dataset I called "scripts" for that is where I locate all my scripts and only script related data.

-Joe
 

IQless

Contributor
Joined
Feb 13, 2017
Messages
142
I have not tested this script on version 22.12.0, but it does run on 22.12.1. While I doubt that is the issue, please explain in terrible detail how and where you installed the script and how you are running it. The very first failure you have is the location of the script directory. I suspect you placed it somewhere it doesn't like. Where is it located? I place my script in a dataset I called "scripts" for that is where I locate all my scripts and only script related data.

-Joe
I could update to 22.12.1 just to be sure.

The location is:
Code:
pwd
/root/scripts/

wget -O wget -O multi_report.sh https://www.truenas.com/community/resources/multi_report-sh-version-for-core-and-scale.179/download
chmod +x multi_report.sh
sh ./multi_report.sh


Probably not the best practice. Would love for hints to place it better!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The location is:
Code:
pwd
/root/scripts/

wget -O wget -O multi_report.sh https://www.truenas.com/community/resources/multi_report-sh-version-for-core-and-scale.179/download
chmod +x multi_report.sh
sh ./multi_report.sh


Probably not the best practice. Would love for hints to place it better!
I have never done this method before to install a script from the the recourses, interesting but I suspect that is the problem. I just share the dataset via SMB and drag and drop it.

When you first run the script, it will fail with a message to configure the script, meaning run ./multi_report.sh -config and then answer the questions to create the configuration file.

You know, you are going to make me try that out so I can see what is the issue. But that won't happen today, I have to leave for work shortly. As I said, interesting.
 

IQless

Contributor
Joined
Feb 13, 2017
Messages
142
I have never done this method before to install a script from the the recourses, interesting but I suspect that is the problem. I just share the dataset via SMB and drag and drop it.

When you first run the script, it will fail with a message to configure the script, meaning run ./multi_report.sh -config and then answer the questions to create the configuration file.

You know, you are going to make me try that out so I can see what is the issue. But that won't happen today, I have to leave for work shortly. As I said, interesting.
I just figured it out.. I'm an idiot

Code:
./multi_report.sh -config (worked)
sh ./multi_report.sh -config (not so much)


Thanks for the help, you did give me the "aha moment"!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm still going to try the installation method you used, it could make things a bit easier to describe.

Glad you figured it out and hope the script works to your liking. There are a lot of options in the configuration section. If you have any reports that are not good and you want a bit of help, please use the -dump email option and it will send me a copy of the report and the information about your drives so I can replicate the issue(s). The only personal information I receive is your email address to which you send your report to. I don't share that with anyone.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
Code:
./multi_report.sh -config (worked)
sh ./multi_report.sh -config (not so much)
If you look into the script the first line reads #!/bin/bash

This defines Bash (Bourne Again Shell) as the interpreter. The equivalent would be to issue bash ./multi_report.sh -config
 

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
Hi @joeschmuck, I upgraded my system yesterday, and I think I broke your script.
I downloaded what I think is the latest version, 2.0.6.

I've added an nmve drive (which is currently not in a pool) and changed my single boot-pool ssd to a mirrored dual ssd boot-pool. report.png
Only the nvme ssd shows even though before it would show my boot-pool ssd.

I also get the following error email from the 'standard error' check box.
./mnt/TrueNAS/scripts/multi_report.sh: line 2772: ( / 8760): syntax error: operand expected (error token is "/ 8760)")
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@GrimmReaperNL
Version 2.0.7 is the current released version. If you have this version then if you could run the script with -dump email and if that runs, I will get some data to try and troubleshoot what is going on. Often this will be caused by a SMART Test or a drive reporting some non-standard report. Most likely we cannot divide a string vice a number. Once the test is over the problem goes away. But if I know what the problem is, I can generally address it.

It would be good to know if the problem is reproducible. If it is, then how.
 

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
@GrimmReaperNL
Version 2.0.7 is the current released version. If you have this version then if you could run the script with -dump email and if that runs, I will get some data to try and troubleshoot what is going on. Often this will be caused by a SMART Test or a drive reporting some non-standard report. Most likely we cannot divide a string vice a number. Once the test is over the problem goes away. But if I know what the problem is, I can generally address it.

It would be good to know if the problem is reproducible. If it is, then how.
No need for a dump, looking up 2.0.7. and upgrading to that fixed the error and look of the report.

Thank you :D
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Sorry you ran into problems. But have no fear, more problems will be coming with the next release. Today is my birthday, had cake and ice cream with the grandkids, hung a ceiling fan three times. Stupid remote control has an issue. I bypassed it and hope Hunter Fans will be able to help out. It's the second fan with this same problem, so not a broken remote receiver but maybe badly designed or built. I ordered a relay so I could fix it myself, the painful support at Hunter is driving me crazy, one question a day. My last question was "Can you take a photo of your wall switch and sent it to us" So I did.

Cheers,
-Joe
 

TooMuchData

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

Two drive recognition fixes, and minor changes from JoeSchmuck.

# V2.0.9 (4 March 2023)
# - Only one running instance allowed.
# - Minor updates to recognize SMART testing in progress for certain drives.
#
# V2.0.8 (23 February 2023)
# - Added Email/Text Monitoring Feature for NugentS to try out.
# - Edit multi_report_config.txt for additional email address.
# - Use '-m' switch to invoke. Statistical data is recorded each time the script is run.
# - Added last two lines to display elapsed time of script running.

Read the rest of this update entry...
 
Top