dmidecode

dmidecode 使用 SMBIOS/DMI 标准,在Linux下收集相关硬件信息

获取CPU型号

]# dmidecode -t processor | grep Version | head -n 1
    Version: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz

获取服务器型号

]# dmidecode | grep 'Product Name'
    Product Name: VMware Virtual Platform
    Product Name: 440BX Desktop Reference Platform

获取主机序列号

]# dmidecode -s system-serial-number
VMware-56 4d 83 35 b6 1a ca 95-e6 c4 c9 f3 b6 e8 69 cd

查看内存的汇总信息

]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range | grep -v "No Module Installed"
    Size: 2048 MB

查看主板支持的最大内存

]# dmidecode|grep 'Maximum Capacity'
    Maximum Capacity: 1 TB

Linux系统查看内存规格信息

]# dmidecode|grep -A16 'Memory Device'|grep 'Speed'
Speed: 1333 MHz
Speed: 1333 MHz
Speed: 1333 MHz
Speed: 1333 MHz

查看CPU信息

]# lscpu 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
座:                 1
NUMA 节点:         1
厂商 ID:           GenuineIntel
CPU 系列:          6
型号:              60
型号名称:        Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
步进:              3
CPU MHz:             3597.915
BogoMIPS:            7195.83
超管理器厂商:  VMware
虚拟化类型:     完全
L1d 缓存:          32K
L1i 缓存:          32K
L2 缓存:           256K
L3 缓存:           8192K
NUMA 节点0 CPU:    0,1