Joseph Trice-Rolph Posted September 30, 2021 Share Posted September 30, 2021 (edited) Hi, First time posting on unraid forum 🙂, been using unraid now for couple of years and loving it. Setup is a Ryzen 3900x on a X470 board with 64GB RAM with 20+2 3TB drives, querky setup with a cut down 24 hotswap bay case for array drives with dual 8088 links, DSub 5W5 power hookup so both main server and drive case powered from main server PSU and most recently PWM passthrough from main server to array case via serial cable with custom fan header links connecting array case fans to main server chasis fan header in main case. Will sort some pictures if anyone interested in seeing my franken server 🙂 Anyway.... Working on a custom script for the array chassis fans, hardware wise am all sorted passing PWM signal from main server to the 24 bay drive only chassis. It has 3 high speed 120x38 server fans on the array case and need some temp controlled PWM to reduce both the noice and power consumption by these beast of fans. Making with custom script as autofan seems to use smart data and wake spun down drives so am checking state to only check temp for spun up drives following an example script from online. Need to isolate drives which are part of the array and struggling to find a way to do so, as only want to check array drives, pool/cache drives are in main server. Will be keeping the main array in the second case specifically and would rather not hard code drives as intend to use 23 and 24th bays for a pair of hot spares and would prefer script to just check any drives which are part of the array and dont want to forget to update list if/when these are used or a drive replaced or to mess with a UI update method. Topics in searches I did listed disks in /dev specifying sd* but unassigned and pool drives will be included in this. Closest I think I've seen is referring to the super.dat file however struggling to get the data in a useable format. Unfortunately havn't got much experience with shell/bash. Got most of the rest sorted already sored based around the custom fan control script on another site modified to use HDDTemp docker and hdparam to check idle state to bypass spun down drives to avoid spinning up drives unnecessarily. Hopefully someone might be able to offer a suggestion 🙂 Edited September 30, 2021 by Joseph Trice-Rolph Quote Link to comment
doron Posted September 30, 2021 Share Posted September 30, 2021 If you can parse /var/local/emhttp/disks.ini you should be on the right track. 1 Quote Link to comment
Joseph Trice-Rolph Posted September 30, 2021 Author Share Posted September 30, 2021 Thanks for the quick reply, looks like that is what I need. It even has temp listed in main gui 🙂 so could do away with the hddtemp docker for cleaner and simpler system. Not got any unassigned drives installed at the minute, will have to check if/how they show and work on parsing that as you say. Quote Link to comment
doron Posted September 30, 2021 Share Posted September 30, 2021 Your unassigned drives will probably find themselves listed in /var/local/emhttp/devs.ini in a similar manner. Good luck! Quote Link to comment
Joseph Trice-Rolph Posted September 30, 2021 Author Share Posted September 30, 2021 Managed to pull out the temp param 🙂 sed -nr "/^\[\"disk2\"\]/ { :l /^temp[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" /var/local/emhttp/disks.ini Looking very promising and cutting out checking for idle etc as can just pull temp direct from that and a chunk of additional complexity in needing to pull from HDDTemp to work around various SMART formats as have mixed drive models. Thanks again, made my evening 👍 Quote Link to comment
Joseph Trice-Rolph Posted October 3, 2021 Author Share Posted October 3, 2021 So thought it would be good to share progress. First time writing bash script so probably a little crude. Have gotten as far as pulling array of disks from disks.ini along with an array or parameters for each disk and outputting a list of disks with either their unraid temp or 'spundown'. Open to any advice or amendment suggestions. ##GET LIST OF ARRAY DISKS declare -a diskList while IFS='= ' read var val do if [[ $var == \[*] ]] then section=${var:2:-2} diskList+=($section) eval declare -A ${section}_data elif [[ $val ]] then if [[ $var == "temp" ]] then eval ${section}_data[temperature]=$val fi eval ${section}_data[$var]=$val fi done < /var/local/emhttp/disks.ini ##CHECK DISKS #echo disklist for disk in "${diskList[@]}" do checkedtemp=0 temp=${disk}_data[temperature] if [[ ${!temp} =~ ^[0-9]+$ ]] then checkedtemp=${!temp} else checkedtemp=spundown fi echo $disk - temperature = $checkedtemp done Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.