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"
This commit is contained in:
Tim Connors 2022-05-16 16:46:06 +10:00
parent 3c86e4f331
commit 0cff0987e5

View file

@ -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) {