From 0cff0987e5073e32006adc59b1b45da1b69173c8 Mon Sep 17 00:00:00 2001 From: Tim Connors Date: Mon, 16 May 2022 16:46:06 +1000 Subject: [PATCH] Discard "not available" hddtemps, eg spundown disks For spundown scsi disks, hddtemp can report "/dev/sdg: TOSHIBA MG04SCA60EE: S.M.A.R.T. not available" --- fan-speed-control.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fan-speed-control.pl b/fan-speed-control.pl index db073b4..8a8bfcf 100755 --- a/fan-speed-control.pl +++ b/fan-speed-control.pl @@ -201,7 +201,7 @@ while () { # could just be a simple pipe, but hddtemp has a strong posibility # to be stuck in a D state, and hold STDERR open despite a kill # -9, so instead just send it to a tempfile, and read from that tempfile - system("timeout -k 1 20 hddtemp /dev/sd? > $tempfilename"); + system("timeout -k 1 20 hddtemp /dev/sd? | grep -v 'not available' > $tempfilename"); @hddtemps=`cat < $tempfilename`; } if (!@ambient_ipmitemps) {