在Linux环境中可以使用dmidecode以一种可读的方式dump出机器的DMI(Desktop Management Interface)信息。这些信息包括了硬件及BIOS,既可以得到当前的配置,也可以得到系统支持的最大配置,比如支持的最大内存数等。DMI有人也叫SMBIOS(System Management BIOS),这两个标准都由DMTF(Desktop Management Task Force)开发。DMI表的意义在于让我们在不探测硬件试题的情况下获取硬件的部分信息,方便了用户,但同时也表明表中的信息可能是不可靠的。
dmidecode使用很简单,直接在提示符下输入运行即可,运行dmidecode需要root权限。常用参数:-q(--quiet显示关键信息) -t(--type指定显示哪方便的内容) -s(--string keyword显示特定关键字) -u(--dump显示二进制dump文件,意义不大)其他的参数可参考man dmidecode
-t文本参数支持bios,system,baseboard,chassis,processor,memory,cache,connector,slot等;同时支持数字参数,数字参数与文本参数对应关系如下:
dmidecode支持的数字参数:
Type Information
----------------------------------------
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