How to get a server’s serial number from shell

Shell ScriptsThere are sometimes when we need a box serial number — to open a support trouble ticket, for example — and for some reason we just don’t have it. If the box is in a remote datacenter this can be a big problem.

I found a couple of commands that can get you the serial number from the command line. In my particular case, my server was a Dell, so additionally I was able to get the Dell Service Tag (is what Dell asks for to identify the box)

I first tried smbios. The output is divided in several blocks. Look for the one identified as SMB_TYPE_BASEBOARD. If you are looking for the Dell Service Tag you need to look into SMB_TYPE_SYSTEM.


bash-3.00# smbios | less
...
...
ID    SIZE TYPE
256   104  SMB_TYPE_SYSTEM (system information)

  Manufacturer: Dell Inc.
  Product: PowerEdge R710
  Serial Number: *******  <--- This is the Dell Service Tag

  UUID: **************************
  Wake-Up Event: 0x6 (power switch)
  SKU Number:
  Family:

ID    SIZE TYPE
512   72   SMB_TYPE_BASEBOARD (base board)

  Manufacturer: Dell Inc.
  Product: ******
  Version: A02
  Serial Number: ..***************.  <--- This is the box serial number

  Chassis: 0
  Flags: 0x0
  Board Type: 0x0

...
...

ipmitool also does the trick


bash-3.00# ipmitool fru
FRU Device Description : Builtin FRU Device (ID 0)
 Board Mfg             : DELL
 Board Product         : PowerEdge R710
 Board Serial          : **************   <-- This is the number you are looking for
 Board Part Number     : *********

Please note that these commands only work on INTEL boxes. I tried both on Solaris 10 installations.

You can do a similar thing on windows boxes with wmic

C:\Users\Administrator>wmic csproduct get vendor,name,identifyingnumber

I found this useful quick start guide at the University of Virginia's web site

Posted in Sysadmin, Unix. Bookmark the permalink. RSS feed for this post. Leave a trackback.

Swedish Greys - a WordPress theme from Nordic Themepark.