Archive

Posts Tagged ‘TEMPer’

Baby, it’s cold outside

December 18th, 2009 No comments

I posted a few months ago to say that my server wasn’t a massive fan of the high temperature in my loft.

Well, now it’s too cold. The UK has had a bit of a cold snap lately. Outdoor temperatures in Bristol last night got as low as -3 °C, and in turn the temperature in my loft went down to 2.5 °C.

Ambient temperature in my loft

Ambient temperature in my loft

Thing is, that’s probably a bit too cold for my server now. The CPU is happily sitting there at 24 °C but the disks are all around 15 °C.

According to Wikipedia:

A common misconception is that a colder hard drive will last longer than a hotter hard drive. The Google study seems to imply the reverse – “lower temperatures are associated with higher failure rates”. Hard drives with S.M.A.R.T.-reported average temperatures below 27 °C had failure rates worse than hard drives with the highest reported average temperature of 50 °C, failure rates at least twice as high as the optimum S.M.A.R.T.-reported temperature range of 36 °C to 47 °C.

So my disks appear to be at risk of failing sooner. Worse yet, they’re not consistently at 15 °C but fluctuate wildly on a daily and seasonal basis. Looks like all I can do is keep my data on a redundant array and swap out any disks when (not if) they fail.

Categories: Nagios Tags: , ,

The temperature in my loft

November 6th, 2009 No comments

I recently (mid October) moved my home server into my loft, as its constant noise under my desk was getting on my nerves.

However I found that with a large area of roof exposed to the sun (even the weak Autumn sun), and practically no ventilation the ambient temperature fluctuates enormously.

In October when it was a little warmer and a little sunnier, the temperature would drop almost as low at 10°C and almost as high as 30°C. An ambient temperature of over 25°C seems to drive my disk temperatures up to over 50°C. This constantly changing temperature with high and low extremes is a sure-fire way to break hard disks.

After Week 42, I opened the loft trapdoor, which went a long way to keeping the temperature more constant. Unfortunately it also makes the flat rather cold.

Now it’s much colder outdoors, I’ve closed the trapdoor again and the loft temperature seems pleasantly cool and reasonably constant. Today the temperature up there is a steady 13°C, although the sun hardly shone. That’s cooler than your average air-conditioned data centre – and all free thanks to the crappy British weather :)

Oh, and the 6 disks are now all between 25°C and 30°C.

ambient-temperature

  • I’m measuring and graphing this using a TEMPer USB thermometer, using Nagios monitoring software with my own plugin and PNP4Nagios to draw the graphs.
  • The “outage” between weeks 43 and 44 was caused by the shift from BST to GMT, apparently. I didn’t notice for a while, but restarting Nagios fixed it :)
Categories: Gadgets Tags: , , , , ,

Various Nagios plugins

October 15th, 2009 No comments

I’ve now written several Nagios plugins and submitted them all to MonitoringExchange.

Here’s a quick summary:

  • check_temper for monitoring the temperature with a TEMPer USB thermometer
  • check_kernel for checking that the currently running kernel on an RPM-based system is the most recent installed kernel (not necessarily the latest available kernel in the repository)
  • check_aql_balance for monitoring the number of SMS text message credits on your AQL account[1]
  • check_k8temp for monitoring the temperature of an AMD K8 (e.g. Athlon or Sempron) CPU

[1] See my blog post if you are interested in setting up SMS alerts with Nagios

Nagios plugin for TEMPer USB thermometer

October 12th, 2009 11 comments

As I said in a previous post, I finally got my TEMPer USB thermometer to work on Fedora, thanks to a patch by Tollef Fog Heen that has now been incorporated into the Fedora kernel.

I’m not familiar with C so I only made minor tweaks to Tollef Fog Heen’s code, which returns a temperature as a number. I wrote a wrapper in Perl that crudely interfaces this program to Nagios. In reality, I should wise up on my C a little and write the whole thing in C. When I do this, I’ll submit it to Monitoring Exchange.

For the time being, I’ll publish my Nagios plugin on this blog, in the hope that it might be useful to someone, despite being incredibly hacky.

First you’ll need the code for the program that reads the temperature from the TEMPer. Compile it like this:

g++ -o get_temper TEMPer2.c

Note that the path to the TEMPer device is hard-coded in the C If yours isn’t at /dev/ttyUSB0 then you’ll need to change the source before compiling.

Then download my Nagios plugin (check_temper), and put both the plugin and the program get_temper in your Nagios plugin directory. This is likely to be /usr/local/nagios/libexec if you built from source, and /usr/lib/nagios/plugins if you installed from RPM in the Fedora repository.

Now all you have to do is the usual Nagios magic for adding any other plugin. Simple!

Update

Forget all that you’ve read above! I’ve now rewritten the entire plugin in C, so there is no need for the perl wrapper. You can download it from MonitoringExchange.

TEMPer USB thermometer on Linux

October 12th, 2009 3 comments

Some time ago I bought a cheap USB thermometer called TEMPer. I was disappointed to find that it didn’t work on Fedora. It would only work on Windows using a poor piece of proprietary software.

I eventually found the blog of Tollef Fog Heen, who had managed to get his TEMPer to work. Unfortunately his solution involved patching and compiling a kernel.

However since then, it seems his patch has been integrated into the stock Fedora kernel and it is now possible to read the temperature from it.

The TEMPer device appears to be a USB-serial adapter, with a serial I2C device at the end of it. It’s not straightforward to extract the temperature from it, but Tollef Fog Heen has written a simple C program to return the temperature.

His program polls the TEMPer every second and prints the temperature to the command line. It doesn’t stop until you kill the program. I made a couple of tweaks to the code so it prints the temperature once, formatted as a raw number with no extra text, and then quits. You can find my modified source here.

Disclaimer: I don’t know C. I haven’t changed any of the logic of the code, only the way it prints the output. If the code is buggy, it wasn’t me! ;)

Now I have an executable that returns the temperature from the TEMPer, I can think about building some application that could use this. How about a Nagios plugin?