Dmidecode简介                      

DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。 SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。

DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format (MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。

dmidecode的输出格式一般如下:              

Handle ×
DMI type , bytes
Base Board Information
Manufacturer:Intel
Product Name: C440GX+
Version: -
Serial Number: INCY92700942

其中的前三行都称为记录头(recoce Header), 其中包括了:

、recode id(handle): DMI表中的记录标识符,这是唯一的,比如上例中的Handle ×。
、dmi type id: 记录的类型,譬如说:BIOS,Memory,上例是type ,即”Base Board Information”
、recode size: DMI表中对应记录的大小,上例为8 bytes.(不包括文本信息,所有实际输出的内容比这个size要更大。)
记录头之后就是记录的值:
、decoded values: 记录值可以是多行的,比如上例显示了主板的制造商(manufacturer)、model、version以及serial Number。

dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。

dmidecode命令用法详解                  

不带选项执行 dmidecode 通常会输出所有的硬件信息。Dmidecode 有个很有用的选项 -t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行

[root@master ~]# dmidecode -t
dmidecode: option requires an argument -- 't'
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot
[root@master ~]# dmidecode -t processor
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present. Handle 0x0004, DMI type , bytes
Processor Information
Socket Designation: CPU #
Type: Central Processor
Family: Unknown
Manufacturer: GenuineIntel
ID: A7 FF FB AB 0F
Version: Intel(R) Core(TM) i3-2348M CPU @ .30GHz
Voltage: 3.3 V
External Clock: Unknown
Max Speed: MHz
Current Speed: MHz
Status: Populated, Enabled
Upgrade: ZIF Socket
L1 Cache Handle: 0x0094
L2 Cache Handle: 0x0114
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count:
Core Enabled:
Characteristics:
-bit capable
Execute Protection
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列表              

[root@master ~]# dmidecode -s
dmidecode: option requires an argument -- 's'
String keyword expected
Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency
[root@master ~]# dmidecode -t
dmidecode: option requires an argument -- 't'
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

查看内存槽数、那个槽位插了内存,大小是多少          

[root@master ~]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
Size: MB

查看最大支持内存数                      

[root@master ~]# dmidecode|grep -P 'Maximum\s+Capacity'
Maximum Capacity: GB

查看槽位上内存的速率,没插就是unknown。          

[root@master ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
Speed: Unknown

以上均是通过dmidecode命令来实现的,具体方法如下:
dmidecode以一种可读的方式dump出机器的DMI(Desktop Management Interface)信息。这些信息包括了硬件以及BIOS,既可以得到当前的配置,也可以得到系统支持的最大配
置,比如说支持的最大内存数等。

DMI有人也叫SMBIOS(System Management BIOS),这两个标准都由DMTF(Desktop Management Task Force)开发。

dmidecode的使用方法                        

1. 最简单的的显示全部dmi信息:

[root@master ~]# dmidecode 

将输出所有的dmi信息。

2.更精简的信息显示:

[root@master ~]# dmidecode -q

-q(–quite) 只显示必要的信息,这个很管用哦。

3.显示指定类型的信息:

通常我只想查看某类型,比如CPU,内存或者磁盘的信息而不是全部的。这可以使用-t(–type TYPE)来指定信息类型:

[root@master ~]# dmidecode -t bios
[root@master ~]# dmidecode -t bios, processor
Invalid type keyword: bios,
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot
[root@master ~]# dmidecode -t 0, 4

dmidecode到底支持哪些type?

这些可以在man dmidecode里面看到:

文本参数支持:
bios, system, baseboard, chassis, processor, memory, cache, connector, slot

4. 通过关键字查看信息:

比如只想查看序列号,可以使用:
代码示例: 

[root@master ~]# dmidecode -s system-serial-number
VMware- 4d b7 f3 1e -b4 a6 1d e3
-s (–string keyword)支持的keyword包括:
bios-vendor,bios-version, bios-release-date,
system-manufacturer, system-product-name, system-version, system-serial-number,
baseboard-manu-facturer,baseboard-product-name, baseboard-version, baseboard-serial-number, baseboard-asset-tag,
chassis-manufacturer, chas-sis-version, chassis-serial-number, chassis-asset-tag,
processor-manufacturer, processor-version.

5. 下面是一些测试示例。

5.1 查看当前内存和支持的最大内存

Linux下,可以使用free或者查看meminfo来获得当前的物理内存:

代码示例:

[root@master ~]# free
total used free shared buff/cache available
Mem:
Swap:
[root@master ~]# grep MemTotal /proc/meminfo
MemTotal: kB

服务器到底能扩展到多大的内存?

[root@master ~]# dmidecode -t
[root@master ~]# dmidecode 2.7
[root@master ~]# dmidecode -t  |more
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present. Handle 0x01A3, DMI type , bytes
Memory Device
Array Handle: 0x0025
Error Information Handle: No Error
Total Width: bits
Data Width: bits
Size: MB        #有一条512兆的内存条。
Form Factor: DIMM
Set: None
Locator: RAM slot #
Bank Locator: RAM slot #
Type: DRAM
Type Detail: EDO
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Rank: Unknown
Configured Clock Speed: Unknown Handle 0x01A4, DMI type , bytes
Memory Device
Array Handle: 0x0025
Error Information Handle: No Error
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None        #没有内存条
Locator: RAM slot #
Bank Locator: RAM slot #
Type: DRAM
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

dmidecode支持的数字参数:

ype  Information
—————————————-
BIOS
System
Base Board
Chassis
Processor
Memory Controller
Memory Module
Cache
Port Connector
System Slots
On Board Devices
OEM Strings
System Configuration Options
BIOS Language
Group Associations
System Event Log
Physical Memory Array
Memory Device
-bit Memory Error
Memory Array Mapped Address
Memory Device Mapped Address
Built-in Pointing Device
Portable Battery
System Reset
Hardware Security
System Power Controls
Voltage Probe
Cooling Device
Temperature Probe
Electrical Current Probe
Out-of-band Remote Access
Boot Integrity Services
System Boot
-bit Memory Error
Management Device
Management Device Component
Management Device Threshold Data
Memory Channel
IPMI Device
Power Supply

Dmidecode命令的更多相关文章

  1. 使用 python 获取 Linux 系统信息(通过dmidecode命令)

    通过 dmidecode 命令可以获取到 Linux 系统的包括 BIOS. CPU.内存等系统的硬件信息,这里使用 python 代码来通过调用 dmidecode 命令来获取 Linux 必要的系 ...

  2. 【转】dmidecode命令详解

    Dmidecode 这款软件允许你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准,其输出的信息包括 BIOS.系统.主板.处理器.内存.缓存等等. ...

  3. linux 查看内存信息,及其他硬件信息 dmidecode命令

    由于想换内存,想看看内存型号.频率,简单搜了下命令 可以用dmidecode 命令查看. dmidecode -t memory 这个命令可以查看内存的几乎所有信息,包括频率 大小等等 另外这个命令强 ...

  4. 如何使用dmidecode命令查看硬件信息

    引言 当我们需要获取机器硬件信息时,可使用linux系统自带的dmidecode工具进行查询. dmidecode命令通过读取系统DMI表,显示服务器硬件和BIOS信息.除了可使用dmidecode查 ...

  5. linux下dmidecode命令获取硬件信息

    linux下dmidecode命令获取硬件信息 2 A+ 所属分类:Linux 运维工具 dmidecode在 Linux 系统下获取有关硬件方面的信息.dmidecode 遵循 SMBIOS/DMI ...

  6. Linux dmidecode 命令

    当我们需要获取机器硬件信息时,可使用linux系统自带的dmidecode工具进行查询. dmidecode 用于获取服务器的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息 这 ...

  7. Linux dmidecode命令

    1.linux系统自带的dmidecode工具查询服务器硬件信息 dmidecode 用于获取服务器的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息 这个命令可以查看内存的几乎 ...

  8. dmidecode 命令

    dmidecode                                                 #  查看全面硬件信息dmidecode | grep "Product ...

  9. linux 命令之 dmidecode

    Dmidecode 这款软件同意你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准.其输出的信息包含 BIOS.系统.主板.处理器.内存.缓存等等. ...

随机推荐

  1. 【Spring JDBC】JdbcTemplate(三)

    传统Jdbc API与Spring jdbcTemplate比较 //JDBC API Statement statement = conn.createStatement(); ResultSet ...

  2. jQuery中的文档处理(五)

    1. append(content|fn), 向每个匹配的元素内部追加内容 在内部结尾添加. 参数说明: content:String, Element, jQuery,要追加到目标中的内容 func ...

  3. 数据仓库010 - MySQL查看所有存储过程,函数,视图,触发器

    .查询数据库中的存储过程和函数 方法一: select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE ...

  4. 转载-用excel批量生成insert语句

    用excel批量生成insert语句   版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/h ...

  5. ng 判定输入的手机号是否正确

    判定输入的手机号是否正确   infoConfirm(){        if (!/^1[3456789]\d{9}$/.test(this.mobile)) {          this.pho ...

  6. Vue.js 源码分析(二十四) 高级应用 自定义指令详解

    除了核心功能默认内置的指令 (v-model 和 v-show),Vue 也允许注册自定义指令. 官网介绍的比较抽象,显得很高大上,我个人对自定义指令的理解是:当自定义指令作用在一些DOM元素或组件上 ...

  7. poj-3230 Travel

    One traveler travels among cities. He has to pay for this while he can get some incomes. Now there a ...

  8. WinForm 窗体间传递数据

    前言 做项目的时候,winfrom因为没有B/S的缓存机制,窗体间传递数据没有B/S页面传递数据那么方便,今天我们就说下winfrom中窗体传值的几种方式. 共有字段传递 共有字段传递实现起来很方便, ...

  9. SpringBoot整合kafka(实现producer和consumer)

    本文代码使用的是Spring Boot 2.1.8.RELEASE 版本 <parent> <groupId>org.springframework.boot</grou ...

  10. 车位iou计算

    车位检测中,判断多帧图像检测出的车位是否是同一个车位.计算其IOU. 判断一个点是否在一个四边形内 Approach : Let the coordinates of four corners be ...