Introduction + New Build: plans, questions and more!

All the questions mentioned in the thread!

  • RAIDZ1 (3 data drives, one parity drive and one hot spare)

    Votes: 0 0.0%
  • RAIDZ2 (3 data drives, 2 parity drives)

    Votes: 6 100.0%
  • Truenas Core ("dont experiment with the OS, silly!")

    Votes: 5 83.3%
  • Truenas Scale (Risk OS bricking, but "should" be safe)

    Votes: 0 0.0%
  • Onboard SATA's -> Do not use!

    Votes: 0 0.0%
  • Onboard SATA's -> use, but.... (please explain :) )

    Votes: 6 100.0%
  • System Specs -> OK

    Votes: 5 83.3%
  • System Specs -> Er.. Not okay?

    Votes: 0 0.0%

  • Total voters
    6
  • Poll closed .

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
Appareantly it's this now?
https://github.com/Spearfoot/FreeNAS-scripts/blob/master/zpool_report.sh

Same result:
1647451559752.png


(HDDSCRIPT1 is the old, 2 is the new, both updated email)

I'm positive i'm doing something wrong, but it's the same way that script from - joeschmuck, modified by Bidelu0hm, then by melp, minor corrections by TooMuchData - works..

I do however find this interesting:

1647451975062.png


The scripts that run are approx 77kB, with 1400 lines of code (apart from the solnet array test), the other scripts are way smaller, like 107 lines of code..

But i checked the github, 107 lines..
 
Last edited:

JohnK

Patron
Joined
Nov 7, 2013
Messages
256
ok I am not really sure why you want to use different users. Most of these scripts will be executed as root using cron.

Anyway, when testing the scripts, you will enter

./mnt/pool/scripts/script.sh

when configuring as a cron command, you will enter
sh /mnt/pool/scripts/script.sh

Hope that makes sense (not using any quotes or enter keys.)
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
ok I am not really sure why you want to use different users. Most of these scripts will be executed as root using cron.

Anyway, when testing the scripts, you will enter

./mnt/pool/scripts/script.sh

when configuring as a cron command, you will enter
sh /mnt/pool/scripts/script.sh

Hope that makes sense (not using any quotes or enter keys.)
Thanks John,

I'll give that a try ;)

Not planning on running multiple scripts, just wanted to see which one i prefer the most.

And when encountering a problem, i just want to fix it or at least try understanding why it is behaving like that.

99.9% so far is user error but i'm learning!:cool:
 

JohnK

Patron
Joined
Nov 7, 2013
Messages
256
Thanks John,

I'll give that a try ;)

Not planning on running multiple scripts, just wanted to see which one i prefer the most.

And when encountering a problem, i just want to fix it or at least try understanding why it is behaving like that.

99.9% so far is user error but i'm learning!:cool:
you're welcome. I'm sure that most of us suffered through the same questions and problems. I have not changed any of my scripts in years, but I do remember the pain getting it to work correctly. Since then, I document everything I do inside OneNote so that it is easier when I have to redo something.

Of course as always, google is your friend. I would recommend reading as it covers a few questions you've had.
https://www.thegeekstuff.com/2010/07/execute-shell-script/
https://www.thegeekstuff.com/2010/01/shell-script-execution-guidelines-for-newbies/
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
when configuring as a cron command, you will enter
sh /mnt/pool/scripts/script.sh
If i do it like you mention, nothing works.

Cron job:
Code:
sh /mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh

Output in mail:
Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh: 402: Syntax error: redirection unexpected (expecting word)
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh: 395: Syntax error: Error in command substitution


if i do it like this:
Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


output:
Code:
Updating statistical datafile
Collecting Drive Information
Running Purging Routine
Sending Email


-> Report mail is ok.

When in console as root, from root, the same code applies:

Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


1647461556149.png


as you can see, changing it to:

Code:
sh /mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh

or

./mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


does not work.

Now i'm definately not saying you're wrong, but it just doesn't work for me, so i'm probably misunderstanding what you are kindly trying to explain to me.
Since it is regarding on how to run things, or get them running and reporting in due time, i find it quite important to learn, so i hope you all bear with me :eek:

Second script still a mystery

1647462569155.png


"Humans run on sweat, if sweat runs out, fetch beer.jar"
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
you're welcome. I'm sure that most of us suffered through the same questions and problems. I have not changed any of my scripts in years, but I do remember the pain getting it to work correctly. Since then, I document everything I do inside OneNote so that it is easier when I have to redo something.

Of course as always, google is your friend. I would recommend reading as it covers a few questions you've had.
https://www.thegeekstuff.com/2010/07/execute-shell-script/
https://www.thegeekstuff.com/2010/01/shell-script-execution-guidelines-for-newbies/
thank you, i'll give that a try tomorrow! :wink:
 

JohnK

Patron
Joined
Nov 7, 2013
Messages
256
If i do it like you mention, nothing works.

Cron job:
Code:
sh /mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh

Output in mail:
Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh: 402: Syntax error: redirection unexpected (expecting word)
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh: 395: Syntax error: Error in command substitution


if i do it like this:
Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


output:
Code:
Updating statistical datafile
Collecting Drive Information
Running Purging Routine
Sending Email


-> Report mail is ok.

When in console as root, from root, the same code applies:

Code:
/mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


View attachment 54122

as you can see, changing it to:

Code:
sh /mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh

or

./mnt/BIGDATA/Prive/mbaert/scripts/HDDREPORT5.sh


does not work.

Now i'm definately not saying you're wrong, but it just doesn't work for me, so i'm probably misunderstanding what you are kindly trying to explain to me.
Since it is regarding on how to run things, or get them running and reporting in due time, i find it quite important to learn, so i hope you all bear with me :eek:

Second script still a mystery

View attachment 54130

"Humans run on sweat, if sweat runs out, fetch beer.jar"
ok, I had some time to install this script. Downloaded it, changed my email and saved it into my script directory. Now most important thing, looking at the script is that it is a bash script so a few things change.


root@freenas:/mnt/pool/scripts # chmod +x multi_report_v1.4c_200313.sh*

root@freenas:/mnt/pool/scripts # ./multi_report_v1.4c_200313.sh*
Updating statistical datafile
Collecting Drive Information
Running Purging Routine
Sending Email

Because it is a bash script, the Cron job becomes:

bash /mnt/pool/scripts/multi_report_v1.4c_200313.sh

Everything working.
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
ok, I had some time to install this script. Downloaded it, changed my email and saved it into my script directory. Now most important thing, looking at the script is that it is a bash script so a few things change.


root@freenas:/mnt/pool/scripts # chmod +x multi_report_v1.4c_200313.sh*

root@freenas:/mnt/pool/scripts # ./multi_report_v1.4c_200313.sh*
Updating statistical datafile
Collecting Drive Information
Running Purging Routine
Sending Email

Because it is a bash script, the Cron job becomes:

bash /mnt/pool/scripts/multi_report_v1.4c_200313.sh

Everything working.
Thats the one i got working too.
My bad, because of the renaming... So sorry.
I will use the original filenames to get things re-organised..

But i went ahead to go and put your info into practice to stretch my fingers:

This script: multi_report_v1.4c_200313.sh

runs as root, from root location with the followig codes:

Code:
bash /mnt/BIGDATA/Prive/mbaert/scripts/multi_report_v1.4c_200313.sh
or
/mnt/BIGDATA/Prive/mbaert/scripts/multi_report_v1.4c_200313.sh


same code applies for the cron jobs, both codes work.
When in the scripts folder as root, again both work, and the 'dot dash' now as well.

So 'dot dash' is working but only when in the correct location as user, where the file is.

Now i know a few ways to get some results, and thanks to your help, connecting some dots, the second script gets a revisit.

Second script, as recommended here to me: https://github.com/Spearfoot/FreeNAS-scripts
Scripts: smart_report.sh, zpool_report.sh

As this is a SHell, script, not a Bash one, if i'm not mistaken, i should use 'sh' instead of 'bash' when executing this script.
This is the same as with Jgreco's solnet array test.which i get working perfectly.

But the smart_report.sh, or anything from 'Spearfoot' for that matter does not work for me at all, using all of the combo's that i've been trying for the last 3 days.

Output is always:

Code:
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: { : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: /usr/local/sbin/smartctl : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: 32: Syntax error: word unexpected

or

sh: cannot open ./mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: No such file or directory


The first i dont understand, as the solnet array test uses 'smartctl' too. So the location is wrong?
The latter is, wrong coding.

I have yet to read up on those links you referred, i'll give it another whack after that.
 

JohnK

Patron
Joined
Nov 7, 2013
Messages
256
Thats the one i got working too.
My bad, because of the renaming... So sorry.
I will use the original filenames to get things re-organised..

But i went ahead to go and put your info into practice to stretch my fingers:

This script: multi_report_v1.4c_200313.sh

runs as root, from root location with the followig codes:

Code:
bash /mnt/BIGDATA/Prive/mbaert/scripts/multi_report_v1.4c_200313.sh
or
/mnt/BIGDATA/Prive/mbaert/scripts/multi_report_v1.4c_200313.sh


same code applies for the cron jobs, both codes work.
When in the scripts folder as root, again both work, and the 'dot dash' now as well.

So 'dot dash' is working but only when in the correct location as user, where the file is.

Now i know a few ways to get some results, and thanks to your help, connecting some dots, the second script gets a revisit.

Second script, as recommended here to me: https://github.com/Spearfoot/FreeNAS-scripts
Scripts: smart_report.sh, zpool_report.sh

As this is a SHell, script, not a Bash one, if i'm not mistaken, i should use 'sh' instead of 'bash' when executing this script.
This is the same as with Jgreco's solnet array test.which i get working perfectly.

But the smart_report.sh, or anything from 'Spearfoot' for that matter does not work for me at all, using all of the combo's that i've been trying for the last 3 days.

Output is always:

Code:
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: { : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: /usr/local/sbin/smartctl : not found
/mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: 32: Syntax error: word unexpected

or

sh: cannot open ./mnt/BIGDATA/Prive/mbaert/scripts/smart_report.sh: No such file or directory


The first i dont understand, as the solnet array test uses 'smartctl' too. So the location is wrong?
The latter is, wrong coding.

I have yet to read up on those links you referred, i'll give it another whack after that.
root@freenas:/mnt/pool/scripts # sh smart_report.sh*
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh: {
: not foundt.sh: /usr/local/sbin/smartctl

I could actually reproduce the same results! and then get it to work.

my recommendation is that when you press the green code button, download the zip and extract it. then edit email.
it seems if you copy the code into notepad, it adds "/r" for rows and that cause the above problem.

once you've just copy the code, it runs with
./smart_report.sh*



figured this out by changing and then running it as bash..
root@freenas1:/mnt/pool3/scripts # bash smart_report.sh*
smart_report.sh: line 2: $'\r': command not found
smart_report.sh: line 4: $'\r': command not found
smart_report.sh: line 7: $'\r': command not found
smart_report.sh: line 10: $'\r': command not found
smart_report.sh: line 27: $'\r': command not found
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
root@freenas:/mnt/pool/scripts # sh smart_report.sh*
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh:
: not foundt.sh: {
: not foundt.sh: /usr/local/sbin/smartctl

I could actually reproduce the same results! and then get it to work.

my recommendation is that when you press the green code button, download the zip and extract it. then edit email.
it seems if you copy the code into notepad, it adds "/r" for rows and that cause the above problem.

once you've just copy the code, it runs with
./smart_report.sh*



figured this out by changing and then running it as bash..
root@freenas1:/mnt/pool3/scripts # bash smart_report.sh*
smart_report.sh: line 2: $'\r': command not found
smart_report.sh: line 4: $'\r': command not found
smart_report.sh: line 7: $'\r': command not found
smart_report.sh: line 10: $'\r': command not found
smart_report.sh: line 27: $'\r': command not found
Yup, works like a charm now!

Thank you!

Glad i'm not seeing ghosts :eek:
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
Update on the build:

- Aquired a Mikrotik CRS326-24G-2S+RM
- bought a pair of fiber and copper 10Gbe trancievers each (S+RJ10, S+85DLC03D)

Can confirm the intel X550 onboard (10Gbe copper) in combo with that switch (or router? o_O) works just fine:

1653215322420.png


1653215385155.png


1653215813993.png


Now i just need help from a friend to set up the the networking wizardry to configure the CRS326, make the 10Gig my primary connection between NAS and Router.

Did notice "Rx lose" ticked for a moment, along with a drop in connection.

1653215862635.png


1653215958009.png


But i presume that's some config that need's to be done.
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
Friend hopped over and, with some magic, the NAS is at 10Gbe :cool:

Went and install my newly received X520-SR2 (Shinz... MAC vendor Chineseknockoff i presume: Uptimed NIC's)

Can confirm Intel X520-SR2 not working on Windows 11 :eek:
Intel Proset config tools are not supported anymore, officially discontinued :mad:

Whatever i tried didn't work to get this card online, it just wont link up.
1653593319910.png


After reading up on the internet, I don't even see official support for Mellanox /Nvidia cx2/3 cards, Intel X520's discontinued, ... on Windows 11.
So back to 1999, for cutting edge network performance, when upgrading to W11? :rolleyes:

Anyone encountered the same, or have a suggestion on what to try?
(will try and get it running on the NAS)

Thank you guy's!
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
Friend hopped over and, with some magic, the NAS is at 10Gbe :cool:

Went and install my newly received X520-SR2 (Shinz... MAC vendor Chineseknockoff i presume: Uptimed NIC's)

Can confirm Intel X520-SR2 not working on Windows 11 :eek:
Intel Proset config tools are not supported anymore, officially discontinued :mad:

Whatever i tried didn't work to get this card online, it just wont link up.
View attachment 55674

After reading up on the internet, I don't even see official support for Mellanox /Nvidia cx2/3 cards, Intel X520's discontinued, ... on Windows 11.
So back to 1999, for cutting edge network performance, when upgrading to W11? :rolleyes:

Anyone encountered the same, or have a suggestion on what to try?
(will try and get it running on the NAS)

Thank you guy's!
Hi everyone,

Eventually got the card working on Windows 10 and 11, also the Intel Proset config utility on both OS's. The trick is to get the Intel Wired drivers 26_6 or below.

1654711049967.png


However the Mikrotik still wont connect to it.
Ordered some FS optics, and give it another try when i receive them.

Cheers!
 

Matthias

Explorer
Joined
Mar 7, 2014
Messages
81
1654878534403.png


Got it up and running ;)

Put an FS SFP+ module in the Mikrotik switch,

Et voila:
initial speed.jpg


Very satisfying... until the system hits a bottleneck:

sustained speed.jpg


Will examine further, and keep you all posted. ;)

Cheers and have a great weekend everyone!
 
Top