Hey @alturismo thank you for the PMW Fan app! It works pretty well, but I needed to do a small fix for it to properly detect the actual temperature of my hard drives. I think this is because of how my specific brand of HDD reports temperature in smartctl and the same issue may not affect other brands. Below a summary that explains what I found, how I patched it on my box, and thoughts on a more appropriate, longer term fix.
Here is how I configured the HDD FAN section:
I noticed that when my drives were all well below 50, the fans were still running at full speed. After investigating further, I realized the problem was related to how the script is parsing the output of smartctl. Specifically, in file , line 26:
_temp=$(smartctl --nocheck standby -iA /dev/$pwm_disk | egrep ^194 | awk '{print $4}' | sed 's/^0*//')
It is pulling the number from the 4th column on the smartctl output line that starts with 194 (temp), which in my case reads as follows:
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 176 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 156 156 021 Pre-fail Always - 7191
4 Start_Stop_Count 0x0032 081 081 000 Old_age Always - 19471
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
9 Power_On_Hours 0x0032 037 037 000 Old_age Always - 46193
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 73
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 28
193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 688962
194 Temperature_Celsius 0x0022 119 108 000 Old_age Always - 31
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 30
You will notice that the temperature is properly reported in Celsius in the last column (RAW_VALUE) as 31 (Celsius) but the 4th column (VALUE) has a value of 119 (??). Digging a bit deeper I found this thread: https://github.com/netdata/netdata/issues/3041 - TL;DR: some manufacturers seem to report a normalized value (between 1-253) under VALUE while reporting the actual temperature in RAW. It looks like the reporter for netdata hacked this by taking RAW by default, unless it is a very high number, in which case it falls back to VALUE.
In any case I changed line 26 to fetch column #10 instead of #4:
_temp=$(smartctl --nocheck standby -iA /dev/$pwm_disk | egrep ^194 | awk '{print $10}' | sed 's/^0*//')
This fix works for me because all my drives (either WD-RED or Seagate-IronWolf) report the right value under RAW. A propper fix would have to check whether RAW or VALUE seems more accurate.