linux 命令之 dmidecode,linuxdmidecode
Dmidecode 這款軟體允許你在 Linux 系統下擷取有關硬體方面的資訊。Dmidecode 遵循 SMBIOS/DMI 標準,其輸出的資訊包括 BIOS、系統、主板、處理器、記憶體、緩衝等等。
apt-get install dmidecode
或者使用官方包安裝:
Dmidecode源碼包:http://download.savannah.GNU.org/releases/dmidecode/
- dmidecode命令用法
不帶選項執行 dmidecode 通常會輸出所有的硬體資訊。Dmidecode 有個很有用的選項 -t,可以按指定類型輸出相關資訊,假如要獲得處理器方面的資訊,則可以執行
dmidecode -t processor
輸出:
SMBIOS 2.6 present.
Handle 0x0004, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU 1
Type: Central Processor
Family: Xeon
Manufacturer: Intel
ID: A5 06 01 00 FF FB EB BF
Signature: Type 0, Family 6, Model 26, Stepping 5
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
Usage: dmidecode [OPTIONS]Options are:-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顯示版本資訊
- dmidecode參數string及type列表
(1)Valid string keywords are:
bios-vendorbios-versionbios-release-datesystem-manufacturersystem-product-namesystem-versionsystem-serial-numbersystem-uuidbaseboard-manufacturerbaseboard-product-namebaseboard-versionbaseboard-serial-numberbaseboard-asset-tagchassis-manufacturerchassis-typechassis-versionchassis-serial-numberchassis-asset-tagprocessor-familyprocessor-manufacturerprocessor-versionprocessor-frequency
(2)Valid type keywords are:
biossystembaseboardchassisprocessormemoryCacheconnectorslot
(3)type全部編碼列表
0 BIOS1 System2 Base Board3 Chassis4 Processor5 Memory Controller6 Memory Module7 Cache8 Port Connector9 System Slots10 On Board Devices11 OEM Strings12 System Configuration Options13 BIOS Language14 Group Associations15 System Event Log16 Physical Memory Array17 Memory Device18 32-bit Memory Error19 Memory Array Mapped Address20 Memory Device Mapped Address21 Built-in Pointing Device22 Portable Battery23 System Reset24 Hardware Security25 System Power Controls26 Voltage Probe27 Cooling Device28 Temperature Probe29 Electrical Current Probe30 Out-of-band Remote Access31 Boot Integrity Services32 System Boot33 64-bit Memory Error34 Management Device35 Management Device Component36 Management Device Threshold Data37 Memory Channel38 IPMI Device39 Power Supply40 Additional Information41 Onboard Device
樣本:
查看伺服器型號:dmidecode | grep 'Product Name'查看主板的序號:dmidecode |grep 'Serial Number'查看系統序號:dmidecode -s system-serial-number查看記憶體資訊:dmidecode -t memory查看OEM資訊:dmidecode -t 11
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。