Microwave Biscuit

Hardware Monitoring

Posted in Linux, ubuntu by microwavebiscuit on June 5, 2007

Due to a recent drive failure an article in the latest Linux Format magazine caught my eye on setting up hardware monitoring. Following the tutorials and examples in the magazine I’m now monitoring much more of my hardware. The first recommendation is to install the package lm-sensors. It’s available in the Ubuntu repositories so I installed it and then configured it. After installing the package, you need to run:

sudo sensors-detect

Which will probe various parts of your system to find what can be monitored. After doing that it will advise you on what new modules need to be loaded in order to use full monitoring. You can add them to /etc/modules so that they are loaded every time your system boots. Additionally, you can load them by typing modprobe modulename if you want to get to work immediately. After loading the modules, if you type sensors at a command prompt, you’ll get some info about your system including temps, etc. Once I got it working I then installed the sensors applet so that I can use some graphical widgets to display system info.

Also of note in the article is configuring smartmontools to monitor the “smart” status of hard drives. Using this package allows you to gather some information from the built in monitoring tools on your drives. Mind you, just because the SMART status is ok doesn’t mean your drive is in perfect health and won’t fail, however conversely, if the SMART status is bad, you would be well advised to start moving stuff off of that drive because it’s almost definitely going to go bad. According to some of the tests I’ve run using smartmontools my “main” drive has about 13,000 hours left on it.

Some quick commands to use with the smartmontools package –

smartctl -i /dev/hda (or whatever drive) – This will let you know if your drive supports SMART and if it’s enabled. Also note, if you have a SATA drive, the command looks like this:

sudo smartctl -i /dev/sda -d ata

The -d ata must be added to the end of any command you use if it’s a SATA drive.

smartctl -H /dev/hda – Basic health report on the drive.

smartctl -t short /dev/hda – Runs a short test on the drive – takes one to two minutes.

smartctl -l selftest /dev/hda – Returns the results of the short (or long test).

smartctl -t long /dev/hda – Runs the long test on the drive – takes 95 minutes or so.

So, using these new tools will hopefully give me a better feel for what my hardware is doing and will help me avoid major hardware issues in the future. For more info get the May 2007 edition of Linux Format magazine!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: