While reviewing the sensor data provided by lm-sensors, I started to wonder if there was an easy way to list hard drive temperatures. The smartctl utility can show this information per drive, but I wanted something that would dump temperatures for all drives in my systems. After a bit of seraching, I came across the hddtemp utility:
$ hddtemp /dev/sd[a-z]
/dev/sda: HITACHI HDS7225SBSUN250G0 36N4US6Y J ?: 35°C /dev/sdb: WDC WD7500AACS-00D6B1: 37°C /dev/sdc: WDC WD7500AACS-00D6B1: 36°C /dev/sdd: WDC WD7500AACS-00D6B1: 38°C
I haven’t read through the hddtemp source code to see if it is using ioctl()’s or /sys to get this information, but I’m stoked that this information is so easy to get to (tying this into Nagios would be kinda nifty). Viva CentOS Linux!