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!

Upgrading Brocade firmware

I recently purchased a Brocade 3200 for my lab, and wanted to upgrade the switch to the latest stable version of firmware. Brocade comes with the “firmwaredownload” command, which can be used to retrieve and load a firmware image from a remote FTP or RSH server:

Switch:admin> firmwaredownload

Server Name or IP Address [host]:
User Name [user]: matty
File Name [/usr/switch/firmware]: /firmware/v3.2.1c
Protocol (RSHD or FTP) [rshd]: ftp
110336+6408+131212, csum ad9a
writing flash 0 ................................................
writing flash 1 ................................................
download complete

Once the firmware image has been downloaded and applied, you can verify the version with the “version” command:

Switch:admin> version

Kernel:     5.4
Fabric OS:  v3.2.1c
Made on:    Wed Jun 20 13:21:52 PDT 2007
Flash:      Wed Jun 20 13:26:05 PDT 2007
BootProm:   Tue Oct 30 10:24:38 PST 2001

I really dig Brocade switches, and am amazed that a switch this old performs so well!

Viewing SCSI device information on Linux hosts

I chatted about the new server I built a few posts back, and wanted a quick way to view the SATA devices in the system. While the dmesg and /proc data can be used to locate this information, I always find the lsscsi utility to be a bit more useful:

$ lsscsi

[0:0:0:0]    disk    ATA      HITACHI HDS7225S V44O  /dev/sda
[1:0:0:0]    cd/dvd  TSSTcorp CDDVDW SH-S223Q  SB03  /dev/scd0

In addition to displaying the device ID, it also provides the vendor string and the device that corresponds to each device ID. Useful utility, and it’s one yum install away.

Using plug-ins to extend the base yum functionality

I’ve written about yum in the past, and how it can be used to manage packages on CentOS Linux hosts. In addition to the base functionality that is available in yum, there are also numerous plugins that can be added to extend the base yum feature set. The full list of plugins can be viewed with with yum “list” option:

$ yum list | egrep “^yum”

yum.noarch                                 3.2.19-18.el5.centos        installed
yum-fastestmirror.noarch                   1.1.16-13.el5.centos        installed
yum-metadata-parser.x86_64                 1.1.2-2.el5                 installed
yum-updateonboot.noarch                    1.1.16-13.el5.centos        installed
yum-updatesd.noarch                        1:0.9-2.el5                 installed
yum-verify.noarch                          1.1.16-13.el5.centos        installed
yum-NetworkManager-dispatcher.noarch       1.1.16-13.el5.centos        base     
yum-aliases.noarch                         1.1.16-13.el5.centos        base     
yum-allowdowngrade.noarch                  1.1.16-13.el5.centos        base     
yum-changelog.noarch                       1.1.16-13.el5.centos        base     
yum-cron.noarch                            0.6-1.el5.centos            extras   
yum-downloadonly.noarch                    1.1.16-13.el5.centos        base     
yum-filter-data.noarch                     1.1.16-13.el5.centos        base     
yum-kernel-module.noarch                   1.1.16-13.el5.centos        base     
yum-keys.noarch                            1.1.16-13.el5.centos        base     
yum-kmod.noarch                            1.1.16-13.el5.centos        base     
yum-list-data.noarch                       1.1.16-13.el5.centos        base     
yum-merge-conf.noarch                      1.1.16-13.el5.centos        base     
yum-priorities.noarch                      1.1.16-13.el5.centos        base     
yum-protect-packages.noarch                1.1.16-13.el5.centos        base     
yum-protectbase.noarch                     1.1.16-13.el5.centos        base     
yum-refresh-updatesd.noarch                1.1.16-13.el5.centos        base     
yum-security.noarch                        1.1.16-13.el5.centos        base     
yum-tmprepo.noarch                         1.1.16-13.el5.centos        base     
yum-tsflags.noarch                         1.1.16-13.el5.centos        base     
yum-upgrade-helper.noarch                  1.1.16-13.el5.centos        base     
yum-utils.noarch                           1.1.16-13.el5.centos        base     
yum-versionlock.noarch                     1.1.16-13.el5.centos        base     
yumex.noarch                               2.0.3-2.el5.centos          extras   

Of the available plugins, here are a few of my favorites:


Description: yum-utils is a collection of utilities and examples for the yum package manager. It
           : includes utilities by different authors that make yum easier and more powerful to use.
           : These tools include: debuginfo-install, package-cleanup, repoclosure, repodiff, repo-
           : graph, repomanage, repoquery, repo-rss, reposync, repotrack, verifytree, yum-builddep,
           : yum-complete-transaction, yumdownloader, yum-debug-dump and yum-groups-manager.


Description: Runs yum update on system boot. This allows machines that have been turned off for an
           : extended amount of time to become secure immediately, instead of waiting until the next
           : early morning cron job.


Description: This plugin adds the commands verify, verify-all and verify-rpm. There are also a
           : couple of options. This command works like rpm -V, to verify your installation.


Description: This plugin adds a --downloadonly flag to yum so that yum will only download the
           : packages and not install/update them.


Description: This plugin adds the commands list- vendors, groups, packagers, licenses, arches,
           : committers, buildhosts, baseurls, package-sizes, archive-sizes and installed-sizes.


Description: This plugin allows repositories to have different priorities. Packages in a repository
           : with a lower priority can't be overridden by packages from a repository with a higher
           : priority even if repo has a later version.


Description: This plugin sorts each repository's mirrorlist by connection speed prior to downloading
           : packages.


Description: This plugin adds a command line option to allow viewing package changelog deltas before
           : or after updating packages.


Description: This plugin adds a --allow-downgrade flag to yum to make it possible to manually
           : downgrade packages to specific versions.

I’ve covered a number of these plugins in previous posts, so check out the archives if you want to learn more

Oracle needs to fix their certification requirements

I have been spending a good bit of my spare time studying for the Oracle RAC certification, and am hoping to get certified by the end of summer. Once thing that annoys me is the fact that you have to attend a vendor training class in order to get certified. This is kinda silly, and I have yet to find a test that I couldn’t pass by studying the product on my own (I have 14 certifications, all of which I got by studying vendor documentation). While I can understand that Oracle wants to make money off the certification process, they should be a bit more flexible and allow people to acquire certifications through self-study (I think you learn more when you study material on your own). Since I don’t have $3,500 to spend on the class, I may have to stop once I get my OCA next month. Bummer!

Server hardware is dirt cheap!

I just built a quad core AMD-based server that I plan to use as a storage host in my lab. The machine has the following configuration:

ASUS M2N-LR motherboard
AMD Opteron 1354 Budapest 2.2GHz Socket AM2 75W processor
8GD of 667MHZ DDR2 ECC memory
4 750GB Western Digital SATA II disk drives
SAMSUNG 22X DVD±R DVD Burner with LightScribe
Antec earthwatts EA500 500W Continuous Power
ARK 4U-500-CA Black 4U Rackmount Case
2 masscool 80MM fans
1 Scythe 120MM case fan
1 Emulex LP1000DC fibre channel adapter

Now that the machine has been up and working for a few days, all I can say is WOW! This machine is blazing fast, and the rack mount case I purchased is absolutely amazing. It is extremely well constructed, and has TONS of space for future expansion. This rig is able to run opensolaris and CentOS Linux, and I couldn’t be happier with my purchase. Everything cost just over $600 (NewEgg and eBay rock!), which I think is an incredible price for a machine with these specifications. This machine will be a great storage server once I get COMSTAR configured!