CrudVision - Lisa Seelye

May 11, 2008

Graphing Hard Disk Temperatures with rrdtool (part 2)

Filed under: gentoo, graphs, monitoring, rrdtool, ruby — Lisa Seelye @ 5:03 pm

Last month I made a post about using rrdtool and ruby to graph hard disk temperatures. I recently had some hardware trouble and something with permissions went crazy. Today I took the time to look into the problem and fix it.

The /dev/hd[egik] device nodes were owned by root:disk and 660. However, the hddtemp binary was trying to do some restricted ioctl operations. Even though the binary was setuid and my non-root user was in the disk group I couldn’t access the disk to get the temperatures.

I found out that there is a hddtemp daemon which can query the disks for my unpriveleged user.

The daemon listens on a TCP port and provides output like this:

|/dev/hde|ST3160811AS|39|C||/dev/hdg|ST3160811AS|40|C||/dev/hdi|ST3160811AS|38|C||/dev/hdk|ST3160815AS|39|C|

Should be easy to modify my disk_temperature.rb to connect to that port and parse the data.

Now my temperature graphs will have new data (as soon as the change is made).

April 12, 2008

Graphing hard disk temperatures with rrdtool and Ruby

Filed under: graphs, linux, monitoring, rrdtool, ruby — Lisa Seelye @ 2:27 pm

Since I got to North America I have wanted to put my system under better monitoring. It’s got four active hard disks (and a fifth powered, not active) hard disk in an IcyDock MB-455SPF 5-Bay Internal SATA Drive Enclosure (Manufacturer site, icydock.com, seems offline so link to where I bought it!) with the four active disks plugged into a HighPoint RocketRaid 1640 SATA controller.

I can easily use S.M.A.R.T. to monitor the temperature and the hddtemp Linux utility to get the temperatures of the disks.

It’s easy to use a crontask to poll the disks and to stuff the temperatures into an rrdtool database. I drew much inspiration from Martin Pot’s Perl script to do the same thing but implemented my own in a Ruby Rake task using the woefully undocumented RubyRRDtool gem and a custom hddtemp wrapper class to get the temperatures.

The similarities between my Rake task and Martin’s RRDtool-fu is obvious, however I wanted an hour graph too and so I added it in on line 17.

My next task is to combine the temperatures (lines) of all four disks into a single graph to get a feel for the overall temperature of the disks on one image.

The graphs can be seen at my personal website.

Powered by WordPress