[script] drive temps

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134
Thank you! The colors are a bit hard to read though?
That maybe due to the color of your terminal background since I chose grey for the serial numbers. You can always update the ansi color codes to your liking. Look for this code \e[90m and change the number to whatever you want below.

1629989204328.png
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Thanks again. Will that affect the emails? (I want to be able to run manually and have it sent to me on a schedule)
 

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Are you aware of anything that could be ran every minute which would send an alert if drive temps spike? It was an issue with my old freenas because of the case but I'm using a new case with alot of fans so they are all in 29-35c ranges.

There was a collection of freenas scripts that would check all sorts of things including sending a smart report of your drives but most of those will not run asis with scale. The benefits still outweigh the annoyances as I just got plex working with the gpu being passed in (to a kubernetes container) for hardware transcoding..made a world of difference.
 

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134
Are you aware of anything that could be ran every minute which would send an alert if drive temps spike? It was an issue with my old freenas because of the case but I'm using a new case with alot of fans so they are all in 29-35c ranges.

There was a collection of freenas scripts that would check all sorts of things including sending a smart report of your drives but most of those will not run asis with scale. The benefits still outweigh the annoyances as I just got plex working with the gpu being passed in (to a kubernetes container) for hardware transcoding..made a world of difference.

You can always set a cronjob every minute, but the script would need to be edited to only send emails if it is greater than the HDDMAX or SSDMAX variables. You can/should be using the SMART features built in to TrueNAS for alerting. You can set thresholds for each drive. This definitely is not a replacement or was designed to be an alerting system. I originally wrote this to monitor drive temps after replacing all the fans in my case. I didn't want to wait for something critical to happen before being alerted. I had this scheduled to send emails during system intensive tasks like long SMART tests and scrubs to see if there were any high increases. Those also run in the middle of the night and I was not staying up to monitor drive temps live. It did the job and I ended up splitting up days for my SMART long tests. Some drives tend to run hotter in general so might need to be in a different slot or cabling obstructing air flow, etc.
 

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
You can always set a cronjob every minute, but the script would need to be edited to only send emails if it is greater than the HDDMAX or SSDMAX variables. You can/should be using the SMART features built in to TrueNAS for alerting. You can set thresholds for each drive. This definitely is not a replacement or was designed to be an alerting system. I originally wrote this to monitor drive temps after replacing all the fans in my case. I didn't want to wait for something critical to happen before being alerted. I had this scheduled to send emails during system intensive tasks like long SMART tests and scrubs to see if there were any high increases. Those also run in the middle of the night and I was not staying up to monitor drive temps live. It did the job and I ended up splitting up days for my SMART long tests. Some drives tend to run hotter in general so might need to be in a different slot or cabling obstructing air flow, etc.

Yeah under data protection I setup all drives to run smart short tests daily and smart long one's weekly.....but when I go to storage, disks and click on one then click on "show smart info" it doesn't find anything so somewhere there is a mismatch. I've only had scale installed for about a week so I'm still getting things setup. I went to a new case with ALOT of fans (Antec Three Hundred Two) because older case was letting the drives get to hot which eventually led to failure.
 

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134
Yeah under data protection I setup all drives to run smart short tests daily and smart long one's weekly.....but when I go to storage, disks and click on one then click on "show smart info" it doesn't find anything so somewhere there is a mismatch. I've only had scale installed for about a week so I'm still getting things setup. I went to a new case with ALOT of fans (Antec Three Hundred Two) because older case was letting the drives get to hot which eventually led to failure.

The SMART daemon is different. You configure it under System > Services. You can then fine tune it per drive. See the attached screenshots.
 

Attachments

  • Screen Shot 2021-08-26 at 1.00.12 PM.png
    Screen Shot 2021-08-26 at 1.00.12 PM.png
    338.3 KB · Views: 165
  • Screen Shot 2021-08-26 at 1.00.52 PM.png
    Screen Shot 2021-08-26 at 1.00.52 PM.png
    494.1 KB · Views: 167

Rudi Pittman

Contributor
Joined
Dec 22, 2015
Messages
161
Thanks for explaining things. I appreciate it! Things are a bit different on truenas scale as those tasks are under Data Protection.
 

Attachments

  • 2021-08-26_18-27.png
    2021-08-26_18-27.png
    658.9 KB · Views: 164
Last edited:

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I really hope I am being dumb - but where is the script?
 
Top