Long Term Monitoring of TrueNAS Drives in particular

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Its certainly a change that I would be interested in
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
It will be in the next version.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@NugentS If you cannot get Influx and Grafana configured properly in this Helm/Kubernetes thingy, why not setup a VM on your SCALE NAS? Plain Ubuntu, Influx & Grafana. The closest you can get to a jail on CORE and you will probably even get newer versions of both than available on FreeBSD. The lack of portability of Influx 2.0 sucks so we are stuck with 1.8.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
@Patrick M. Hausen - that is something I have considered - however IX plan on updating the reporting stack - so I am in hold off mode (for the moment).

I already have a nice Ubuntu VM I could use - but it runs portainer, so I would probably set up another (which I have now done)
 
Last edited:

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I am just using the FreeBSD port(pkg) in a jail, so whatever that is. (I only use influx there, then run the latest Grafana in a docker container and point it at the influxdb).
Probably 1.8. Massive difference from current version as it can no longer accept data straight from TN (I think)
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Probably 1.8. Massive difference from current version as it can no longer accept data straight from TN (I think)
My script isn't using TrueNAS' connection to graphite, I'm just pushing individual values via constructed URL, which I would be very surprised to find not working.
 
Joined
Jan 27, 2020
Messages
577
Sorry for the off-topic but summer is approaching and it seems there is still no really sophisticated all-encompassing fan-script for SCALE. Couldn't the bright minds and scripting masters here unite to change that? That would be fabulous.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You might be lucky... I just put my new test SCALE machine together and will be working on my script, so if I can get it working, you will get what you need.
 
Joined
Jan 27, 2020
Messages
577
You might be lucky... I just put my new test SCALE machine together and will be working on my script, so if I can get it working, you will get what you need.
If I can be of any assistance with testing or something, let me know!
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
My script isn't using TrueNAS' connection to graphite, I'm just pushing individual values via constructed URL, which I would be very surprised to find not working.
Could you post a screenshot of what you actually see please?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Here is a hacked together modification of my script.

  1. Run the script. It will update the multi_report_config.txt file.
  2. You will need to edit the config file and modify the ‘urgentemail’ address. My example below has two addresses.
urgentemail="5405551212@vtext.com,joeschmuckatelli2002@hotmail.com"

What this does is sends my smartphone a Text Message through my Verizon carrier, and also send an email. The down side is my carrier only allows so many characters. I will minimize wasted characters in version 2.1 but the email account option is the best as you will get all the data.
  1. While you are editing the config file, change any alarm setpoints you need to. The script will send a message for ANY Alarm.
  2. Run the script using the ‘-m’ switch. You can run from the command line or I’m sure you will place in a CRON job.
  3. The Statistical Database will be updated each time the script it run. This allows you to capture any trends.
  4. The statistical database file by default holds 720 days of data. That could be a lot of data if you run the script frequently.
The Warning ! You cannot run two instances of this script in the same machine at once. For example, if you are running this daily at 2:00 AM then you should not run it between 1:55 AM and 2:05 AM (I like the cushion) or it will fail when it tries to write to a file that is already open. It takes approximately 17 seconds for the script to run on my machine. I did make a CRON job to test every 10 minutes on the 5's (5,15,25,35,45,55)
 

Attachments

  • multi_report_v2.0.8beta_20_Feb_2023.txt
    337.9 KB · Views: 93

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Time to run on mine = 1 min and 33 seconds
:smile:
Thank you - I shall give this a try
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
You might be lucky... I just put my new test SCALE machine together and will be working on my script, so if I can get it working, you will get what you need.
Yes please
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Remember, the temperature threshold needs to be exceeded, not matched for the alarm to be present. I will fix that on the next version, something I should have fixed a long time ago. It's minor but an alarm setpoint should alarm when that setpoint is reached, not exceeded.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Could you post a screenshot of what you actually see please?
1676998780807.png


Is that what you were looking for?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If I can be of any assistance with testing or something, let me know!
Yes please
OK, so I managed to get my test system up after a few hours of bashing my head on an old problem that turned out to be caused by an ad-blocker... anyway, it's running.

I have a couple of issues though:

1. It's a VM, so I don't get CPU temps / no sensors. So I have tested it only with the options set for "$cpu_temp_control = 1" and "$cpu_fans_cool_hd = 1". Obviously that's not what others would want to do so I set those ones to 1 instead of 0. Remembering that the original script doesn't actually recommend to control the CPU FAN instead of the CPU_FAN header on most MoBos, just to control the outlet fans behind the CPU, so that's something that may not even be necessary if you have a good CPU FAN and can leave your rear case fans at an optimal speed.

2. I'm using an OpenCorsairLink device (commander pro) passed into the VM as a USB device... so can only test that option, not the other 2 options I have in the script (ASRock or Supermicro)

So if somebody wants to have a look at it and let me know how it goes, Great!

I have it set for everything to go in /root/ for now, but you could put it somewhere in a pool if you prefer and update the locations in the MASTER file.

It's currently set for linux OS (SCALE) and for supermicro fan control.

Edit the MASTER file to fill in your needed variables... I would recommend looking at these 3 and see if you want to mess with influx or not... make sure you create the DB on the influx server with a matching name.

$use_influx = 1
$influxdb_db="freenas"
$influxdb_host="192.168.1.1"

it's important that you also set your fan max speeds to numbers that your fan can actually hit:

$cpu_max_fan_speed = 2200
$hd_max_fan_speed = 1500


You should set the MASTER file to executable first, then run it.
 

Attachments

  • fancontrol.zip
    17.4 KB · Views: 119

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Stuff....
This sends the data to influxdb - I guess version 1.8? Current versiona of influxdb seem to need telegraf in order to get data
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
This sends the data to influxdb - I guess version 1.8?
That's the latest available version in pkg... I guess you're running it in SCALE then... I'll have a look at the SCALE App.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, so I think I better understood what you wanted... just a script to log HDD temperatures to influx (and not to control fans).

So I have now put together something that gets results for me on SCALE... with a few new (and IMHO defeating the purpose of influxdb's simplicity) required variables to work with the new API.

You'll need to do these things on your influx server's web console:

Create an admin user with a password (you won't see the console otherwise)

Select an org name (I called mine "home")

Create a bucket for use with TrueNAS (I called mine "freenas" due to legacy reasons)

Create an API token for the script to use (and make sure you capture it before dismissing the screen, as you can't see it again).

Fill those in at the top of the script. and set your influx server's IP and the name it will prepend to all values (to allow for collecting to the same DB from multiple hosts... I used fantest_ for now, but make it your SCALE servername).

Copy the script somewhere on your box and chmod +x to allow execution.

run it ./influxtemps_SCALE.pl initially at the CLI just to see how it goes.

We may need a little back and forth to make sure it's getting all your disks (I allow it to pick up HDD and SSDs and it has the option to capture NVMEs if present also).

If you see data appearing in influx after running it once, set a cron task to run it repeatedly.

This will only work with an influx server supporting API V2 (so not 1.8 or before, but should also support 2.6).

You don't need Telegraf.
 

Attachments

  • influxtemps_SCALE.pl.zip
    2.1 KB · Views: 72
Top