公司linux系统服务器业务一般都在外地,如果某时想知道,服务器的CPU、主板,内存型号或者bios信息怎么办?除了到机房或者重启服务器按delete进入bios查看,还

 
有没有更好的办法?答案是肯定的,有!不需要到机房、不需要重启进入bios。使用dmidecode 命令即可查看服务器一些硬件信息和bios信息。配置使用方法如下:
 
Dmidecode简介
DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。 SMBIOS(System Management BIOS)
 
是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性的技术标准,其中
 
DMI设计适用于任何的平台和操作系统。
 
1.软件安装
 
#查看软件包是否安装
 
rpm -qa|grep dmidecode
dmidecode-2.11-2.el6.x86_64
 
 
#如果没有安装,使用下面命令安装;
yum install -y dmidecode
 
#参数
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
从设备文件读信息,输出内容与不加参数标准输出相同
-h, --help Display this help text and exit
显示帮助信息
-q, --quiet Less verbose output
显示更少的简化信息
-s, --string KEYWORD Only display the value of the given DMI string
只显示指定DMI字符串的信息
-t, --type TYPE Only display the entries of given type
只显示指定条目的信息
-u, --dump Do not decode the entries
显示未解码的原始条目内容
--dump-bin FILE Dump the DMI data to a binary file
--from-dump FILE Read the DMI data from a binary file
-V, --version Display the version and exit
显示版本信息
 
#有效输入关键词:
bios
system
baseboard
chassis
processor
memory
Cache
connector
slot
 
#全部编码列表
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device
 
 
#使用方法
 
#事例1
dmidecode -t bios
 
# dmidecode 2.11
SMBIOS 2.5 present.
 
Handle 0x0005, DMI type 0, 24 bytes
BIOS Information
Vendor: Intel Corp.
Version: S3420TH.86B.01.01.0011.121620091734
Release Date: 12/16/2009
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 8192 kB
Characteristics:
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
BIOS Revision: 17.19
Firmware Revision: 0.0
 
Handle 0x001E, DMI type 13, 22 bytes
BIOS Language Information
Language Description Format: Long
Installable Languages: 1
en|US|iso8859-1
Currently Installed Language: en|US|iso8859-1
 
#事例2
dmidecode -t system
 
# dmidecode 2.11
SMBIOS 2.5 present.
 
Handle 0x0002, DMI type 1, 27 bytes
System Information
Manufacturer: Not Specified
Product Name: Lenovo WQ R512 G2
Version: ....................
Serial Number: NC123456789
UUID: Not Present
Wake-up Type: AC Power Restored
SKU Number: Not Specified
Family: Not Specified
 
Handle 0x001A, DMI type 12, 5 bytes
System Configuration Options
Option 1: J1G2/J9J1 2-3: Close to clear CMOS
 
Handle 0x001B, DMI type 12, 5 bytes
System Configuration Options
Option 1: J2G3/J9H3 2-3: Close for BIOS Recovery
 
Handle 0x001C, DMI type 12, 5 bytes
System Configuration Options
Option 1: J1A1/J5A1 2-3: Close to Force BMC Update Mode
 
Handle 0x0020, DMI type 32, 20 bytes
System Boot Information
Status: No errors detected

 

如HP服务器
[root@nj-mobile-dns-log ~]# dmidecode -t 1
# dmidecode 2.9
SMBIOS 2.6 present.
 
Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: HP
        Product Name: ProLiant DL385 G7
        Version: Not Specified
        Serial Number: CNG037T26G       
        UUID: 35373331-3232-434E-4730-333754323647
        Wake-up Type: Power Switch
        SKU Number: 573122-B21     
        Family: ProLiant 
 
 
IBM的刀片服务器
[root@JSNJ-KXY4F-PS-KD-DNS-SV04-CA wujunfeng]# /usr/sbin/dmidecode -t 1
# dmidecode 2.10
SMBIOS 2.5 present.
 
Handle 0x000A, DMI type 1, 27 bytes
System Information
        Manufacturer: IBM
        Product Name: BladeCenter HS22 -[7870XPT]-
        Version: 07
        Serial Number: 99W1617
        UUID: 9492C104-1183-11E1-8516-3440B5802768
        Wake-up Type: <OUT OF SPEC>
        SKU Number: XxXxXxX
        Family: System x