最新消息:

Linux学习笔记之dmicode命令

Linux ipcpu 6025浏览

dmidecode可以读出机器的DMI(Desktop Management Interface)信息。
这些信息包括了硬件以及BIOS、系统、主板、处理器、内存、缓存等等。
dmidecode在很多Linux上是默认安装的,比如centos等。
使用方法:
#dmidecode
#dmidecode -t 1
下面是网友总结的一些常用方法,写在前面方便查找。
#查看服务器型号:
dmidecode |grep -A8 "System Information" |grep "Product Name"|sed 's/^[ \t]*//'
#查看硬件编号:
dmidecode |grep -A8 "System Information" |grep "Serial Number" |sed 's/^[ \t]*//'
#现有内容数量和容量:
dmidecode |grep -A16 "Memory Device" |grep "Size" |sed 's/^[ \t]*//'
#最大支持内存容量:
dmidecode |grep "Maximum Capacity"  |sed 's/^[ \t]*//'
注意grep -A的用法
-A NUM, –after-context=NUM
打印出紧随匹配的行之后的下文 NUM 行。在相邻的匹配组之间将会打印内容是 — 的一行。
下面举几个例子,由于默认输出的内容太多,这里只挑几个类型。
#dmidecode -t 4
Handle 0x0400, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU1
Type: Central Processor
Family: Xeon
Manufacturer: Intel
ID: 7A 06 01 00 FF FB EB BF
Signature: Type 0, Family 6, Model 23, Stepping 10
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Xeon(R) CPU           E5420  @ 2.50GHz
Voltage: 1.4 V
External Clock: 1333 MHz
Max Speed: 3600 MHz
Current Speed: 2500 MHz
Status: Populated, Enabled
Upgrade: Socket LGA771
L1 Cache Handle: 0x0700
L2 Cache Handle: 0x0701
L3 Cache Handle: 0x0702
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count: 4 ###4个核
Core Enabled: 4
Thread Count: 4
Characteristics:
64-bit capable
此处可以查看CPU信息
这里的信息不能作为判断CPU核心数、以及是否支持64的依据,相关信息请查看本站其他文章。
#dmidecode -t 1
Handle 0x0100, DMI type 1, 27 bytes
System Information
Manufacturer: Dell Inc.
Product Name: PowerEdge R710
Version: Not Specified
Serial Number: G[此处保密]
UUID: 44454C4C-[此处保密]
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified
此处信息有机器型号、Serial Number 序列号、UUID等
#dmidecode -t 8
Handle 0x0808, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: USB Port
Internal Connector Type: Access Bus (USB)
External Reference Designator: Not Specified
External Connector Type: None
Port Type: USB
Handle 0x0809, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: Not Specified
External Connector Type: RJ-45
Port Type: Network Port
此处可以查看接口信息
#dmidecode -t 16
Handle 0x1000, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 65280 MB
Error Information Handle: Not Provided
Number Of Devices: 8
此处可以查看主板支持最大内存
#dmidecode -t 17
Handle 0x0035, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0031
Error Information Handle: No Error
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: 2
Locator: DIMM2B
Bank Locator: BANK2
Type: DDR
Type Detail: Synchronous
Speed: 266 MHz (3.8 ns)
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
此处可以查看内存条信息
附: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
40 Additional Information
41 Onboard Device
参考资料:
http://bbs.linuxtone.org/thread-7560-1-1.html
http://linuxtoy.org/archives/dmidecode.html
http://huanxiangwu.com/449/linux-dmidecode

转载请注明:IPCPU-网络之路 » Linux学习笔记之dmicode命令