Wednesday, July 23, 2008

Excellent Linux Command: dmidecode

I can't believe I didn't know about this command. I mean, it's so simple, but it reveals SO much information.

As root, run "dmidecode" and pipe it to the pager of your choice, like this:


root@newcastle:/home/bandman# dmidecode | more
# dmidecode 2.9
SMBIOS 2.3 present.
72 structures occupying 2461 bytes.
Table at 0x000F0450.
--snip--


If you scroll down just a little ways, you start getting better information:


BIOS Information
Vendor: Dell Inc.
Version: A09
Release Date: 06/22/2005
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 512 kB
Characteristics:


There's more:


Base Board Information
Manufacturer: Dell Inc.
Product Name: 0M3918
Version:
Serial Number: ..CN7082154I04CU.

Handle 0x0300, DMI type 3, 13 bytes
Chassis Information
Manufacturer: Dell Inc.
Type: Mini Tower
Lock: Not Present
Version: Not Specified
Serial Number: CPJLT71
Asset Tag:
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: None



You have to look at it yourself to believe all the information it provides. Never again will I wonder what the model number on one of my servers is:


[root@a-fs2 ~]# dmidecode --type 1
# dmidecode 2.7
SMBIOS 2.4 present.

Handle 0x0100, DMI type 1, 27 bytes.
System Information
Manufacturer: Dell Inc.
Product Name: PowerEdge 1955
Version: Not Specified
Serial Number: JJN2LF1
UUID: 44454C4C-4A00-104E-8032-CAC04F4C4631
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified


Read the manpage on it. I'm going to get right on a script to go pick up the information from remote servers and present it in a meaningful way. That should be an excellent way to provide information for the wiki


[EDIT]

As Brandon mentioned in the comments, "hwinfo" is another neat command that doesn't get installed by default (at least on my Ubuntu/RedHat systems), but definitely seems worth the time to get.