公司linux系統服務器業務通常都在外地,若是某時想知道,服務器的CPU、主板,內存型號或者bios信息怎麼辦?除了到機房或者重啓服務器按delete進入bios查看,還linux
有沒有更好的辦法?答案是確定的,有!不須要到機房、不須要重啓進入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