Viewing hard drive temperatures on Linux hosts

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!

One Comment

tux9876  on September 20th, 2009

Nice tools…
Used to do this with smartctl command | grep | sed | awk | whatever to extract temperature line !
With Centos this tool is located in extras packages so… do not forget to allow extras section with yum !
Thanks and yes Viva Centos ;-)

Leave a Comment