Skip to content

Commit

Permalink
Discard "not available" hddtemps, eg spundown disks
Browse files Browse the repository at this point in the history
For spundown scsi disks, hddtemp can report "/dev/sdg: TOSHIBA
MG04SCA60EE: S.M.A.R.T. not available"
  • Loading branch information
spacelama committed May 16, 2022
1 parent 3c86e4f commit 0cff098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fan-speed-control.pl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ END
# 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) {
Expand Down

0 comments on commit 0cff098

Please sign in to comment.