Quantcast
Channel: All System Administration posts
Viewing all articles
Browse latest Browse all 1179

Re: How to get Serial number in Linux w/o using dmidecode

$
0
0

Something that just came up yesterday... If you are using a newer version of the HP BIOS (in this case a DL360p with BIOS P71) you might get the following problem:

 

[root@USE406RK54 ~]# dmidecode -s system-serial-number
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.
USE406RK54      
[root@USE406RK54 ~]#

 

The interesting part of this is that you DO get the serial number, however you also get a bunch of text that basically screws up any string scripts that you might be using.   Another way to get this information as the serial number only is the following:

 

/usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}'

 

[root@USE406RK54 init.d]# /usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}'
USE406RK54
[root@USE406RK54 init.d]#

 

This bad behaviour only started with BIOS P71 (just released recently, supporting the new SMBIOS 2.8.0 standard).  The full output of the dmidecode -t 1 is:

 

[root@USE406RK54 init.d]# /usr/sbin/dmidecode -t 1
# dmidecode 2.11
SMBIOS 2.8 present.
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: HP
        Product Name: ProLiant DL360p Gen8
        Version: Not Specified
        Serial Number: USE406RK54      
        UUID: 35363636-3233-5355-4534-3036524B3534
        Wake-up Type: Power Switch
        SKU Number: 666532-B21      
        Family: ProLiant

[root@USE406RK54 init.d]#

 

--

 

Side notes:

 

dmidecode released with CentOS (or RHEL) 6.4 and earlier is version 2.11 which does not support the 2.8 version of SMBIOS.  So you'll not *quite* get the answer you want when using the "dmidecode -s system-serial-number" version of this string. You need dmidecode version 2.12 or later to get the latest ROM BIOS reads from HP Gen8 Gear.

 

Personally I'm trying to see if there is a newer version of dmidecode out there for either centos 6.4 or 6.5 or on the updates that handles the newer SMBIOS 2.8.0 standard (its been published since April 2013, but only recently implemented by HP).


Viewing all articles
Browse latest Browse all 1179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>