Linux查看服务器硬件信息的方法步骤查看服务器硬件信息的方法步骤
主要介绍了Linux查看服务器硬件信息的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学
习吧
Hi,大家好;今天是双12,大家剁手了没。今天给大家带来的是《Linux查看服务器上的硬件信息》本篇文章的示例全部是在服务器(Inspur SA5112M4)上实现的,有些命令在虚拟机上达不到效果
查看服务器型号、序列号查看服务器型号、序列号
root@zhangdaifu# dmidecode -s system-serial-number
root@zhangdaifu# dmidecode -t system | grep -i 'serial number'
Serial Number: 818123456
root@zhangdaifu# dmidecode -t system | grep -i 'System information' -A9 | egrep -i 'manufacturer|product|sial'
Manufacturer: Inspur
Product Name: SA5112M4
查看主板型号查看主板型号
root@zhangdaifu# dmidecode | grep -i -A16 'System information$'
System Information
Manufacturer: Inspur
Product Name: SA5112M4
Version: 01
Serial Number: 818123456
UUID: 7A61462A-D45E-11E8-8FB4-013865DCAE00
Wake-up Type: Power Switch
SKU Number: Default string
Family: Default string
Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: Inspur
Product Name: YZMB-00370-102
Version: SA5112M4
Serial Number: MBJ824S20187B70
Asset Tag: 818123456
查看查看BIOS信息信息
root@zhangdaifu# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 3.0 present.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: American Megatrends Inc.
Version: 4.1.16
Release Date: 06/21/2018
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 8192 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 5.6
Handle 0x006F, 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
查看查看pci信息,即主板所有硬件槽信息信息,即主板所有硬件槽信息
root@zhangdaifu# lspci | head -10
00:00.0 Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 (rev 01)
00:01.0 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 1 (rev 01)
00:01.1 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 1 (rev 01)
00:02.0 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 2 (rev 01)
00:02.2 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 2 (rev 01)
00:03.0 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 3 (rev 01)
00:03.2 PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI Express Root Port 3 (rev 01)
00:04.0 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 0 (rev 01)
00:04.1 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 1 (rev 01)
00:04.2 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 2 (rev 01)
查看查看cpu型号型号
root@zhangdaifu# grep name /proc/cpuinfo | cut -f2 -d: | uniq -c
56 Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
查看系统中实际物理查看系统中实际物理CPU的数量(物理)的数量(物理)
root@zhangdaifu# grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
2
系统中实际物理系统中实际物理CPU的数量(核数)的数量(核数)
root@zhangdaifu# grep 'processor' /proc/cpuinfo | wc -l
56
查看每个物理查看每个物理CPU中中core的个数(即核数)的个数(即核数)
root@zhangdaifu# grep "cores" /proc/cpuinfo | uniq
cpu cores : 14
查看查看CPU的主频的主频
root@zhangdaifu# grep -i MHz /proc/cpuinfo | uniq
cpu MHz : 2899.781
cpu MHz : 2900.156
cpu MHz : 2899.593
cpu MHz : 2899.687
cpu MHz : 2900.156
cpu MHz : 2899.968
cpu MHz : 2900.156
cpu MHz : 2899.875