一、查看服务器硬件信息
(1)查看服务器型号、序列号
[root@Master ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"

(2)查看主板型号
[root@Master ~]# dmidecode |grep -A16 "System Information$"

(3)查看BIOS信息
1[root@Master ~]# dmidecode -t bios 2# dmidecode 2.12 3SMBIOS 2.8 present. 4 5Handle 0x0008, DMI type 0, 24 bytes 6BIOS Information 7 Vendor: HP 8 Version: U19 9 Release Date: 12/27/2015 10 Address: 0xF0000 11 Runtime Size: 64 kB 12 ROM Size: 16384 kB 13 Characteristics: 14 PCI is supported 15 PNP is supported 16 BIOS is upgradeable 17 BIOS shadowing is allowed 18 ESCD support is available 19 Boot from CD is supported 20 Selectable boot is supported 21 EDD is supported 22 5.25"/360 kB floppy services are supported (int 13h) 23 5.25"/1.2 MB floppy services are supported (int 13h) 24 3.5"/720 kB floppy services are supported (int 13h) 25 Print screen service is supported (int 5h) 26 8042 keyboard services are supported (int 9h) 27 Serial services are supported (int 14h) 28 Printer services are supported (int 17h) 29 CGA/mono video services are supported (int 10h) 30 ACPI is supported 31 USB legacy is supported 32 BIOS boot specification is supported 33 Function key-initiated network boot is supported 34 Targeted content distribution is supported 35 UEFI is supported 36 BIOS Revision: 2.0 37 Firmware Revision: 2.40
(3)查看内存槽及内存条
1[root@Master ~]# dmidecode -t memory | head -45 | tail -23 2Memory Device 3 Array Handle: 0x000A 4 Error Information Handle: Not Provided 5 Total Width: 72 bits 6 Data Width: 64 bits 7 Size: 16384 MB 8 Form Factor: DIMM 9 Set: None 10 Locator: PROC 1 DIMM 1 11 Bank Locator: Not Specified 12 Type: DDR4 13 Type Detail: Synchronous Registered (Buffered) 14 Speed: 2133 MHz 15 Manufacturer: HP 16 Serial Number: Not Specified 17 Asset Tag: Not Specified 18 Part Number: 752369-081 19 Rank: 2 20 Configured Clock Speed: 2133 MHz 21 Minimum Voltage: 1.2 V 22 Maximum Voltage: 1.2 V 23 Configured Voltage: 1.2 V 24 25[root@Master ~]#
(4)查看网卡信息
1[root@Master ~]# dmesg | grep -i Ethernet 2igb: Intel(R) Gigabit Ethernet Network Driver - version 5.3.0-k 3igb 0000:04:00.0: Intel(R) Gigabit Ethernet Network Connection 4igb 0000:04:00.1: Intel(R) Gigabit Ethernet Network Connection 5igb 0000:04:00.2: Intel(R) Gigabit Ethernet Network Connection 6igb 0000:04:00.3: Intel(R) Gigabit Ethernet Network Connection 7igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection 8igb 0000:02:00.1: Intel(R) Gigabit Ethernet Network Connection
(5) 查看pci信息,即主板所有硬件槽信息
1[root@Master ~]# lspci | head -10 200:00.0 Host bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 DMI2 (rev 02) 300:01.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02) 400:01.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02) 500:02.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02) 600:02.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02) 700:02.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02) 800:02.3 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02) 900:03.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02) 1000:03.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02) 1100:03.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)
二**、查看CPU信息
**
(1)查看cpu型号
1[root@Master ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 2 40 Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
(2)查看系统中实际物理CPU的数量(物理)
1[root@Master ~]# grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l 22
(3)系统中实际物理CPU的数量(核数)
1[root@Master ~]# cat /proc/cpuinfo |grep 'processor'|wc -l 240
(4)查看每个物理CPU中core的个数(即核数)
1[root@Master ~]# cat /proc/cpuinfo |grep "cores"|uniq 2cpu cores : 10
(5)查看CPU的主频
1[root@Master ~]# cat /proc/cpuinfo |grep MHz|uniq 2cpu MHz : 1200.000 3cpu MHz : 2300.000 4cpu MHz : 1200.000
(6)查看CPU的详细信息
1[root@Master ~]# cat /proc/cpuinfo | head -20 2processor : 0 //逻辑处理器的ID 3vendor_id : GenuineIntel 4cpu family : 6 5model : 63 6model name : Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz //CPU型号 7stepping : 2 8microcode : 54 9cpu MHz : 1200.000 10cache size : 25600 KB 11physical id : 0 12siblings : 20 //相同物理封装处理器中逻辑处理器数 13core id : 0 14cpu cores : 10 //相同物理封装处理器中的内核数 15apicid : 0 16initial apicid : 0 17fpu : yes 18fpu_exception : yes 19cpuid level : 15 20wp : yes 21flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm cqm_llc cqm_occup_llc
(7)查看CPU的相关信息
1[root@Master ~]# lscpu 2Architecture: x86_64 3CPU op-mode(s): 32-bit, 64-bit 4Byte Order: Little Endian 5CPU(s): 40 6On-line CPU(s) list: 0-39 7Thread(s) per core: 2 8Core(s) per socket: 10 9Socket(s): 2 10NUMA node(s): 2 11Vendor ID: GenuineIntel 12CPU family: 6 13Model: 63 14Model name: Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz 15Stepping: 2 16CPU MHz: 1200.000 17BogoMIPS: 4594.43 18Virtualization: VT-x 19L1d cache: 32K 20L1i cache: 32K 21L2 cache: 256K 22L3 cache: 25600K 23NUMA node0 CPU(s): 0-9,20-29 24NUMA node1 CPU(s): 10-19,30-39 25[root@Master ~]#
(8)查看cpu运行模式
1[root@Master ~]# getconf LONG_BIT 264
(9)查看cpu是否支持64bit
1[root@Master ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l 240 3(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)
三**、查看内存信息
**(1)查看内存硬件信息
1root@Master ~]# dmidecode -t memory | head -45 | tail -24 2Handle 0x000C, DMI type 17, 40 bytes 3Memory Device 4 Array Handle: 0x000A 5 Error Information Handle: Not Provided 6 Total Width: 72 bits 7 Data Width: 64 bits 8 Size: 16384 MB 9 Form Factor: DIMM 10 Set: None 11 Locator: PROC 1 DIMM 1 12 Bank Locator: Not Specified 13 Type: DDR4 14 Type Detail: Synchronous Registered (Buffered) 15 Speed: 2133 MHz 16 Manufacturer: HP 17 Serial Number: Not Specified 18 Asset Tag: Not Specified 19 Part Number: 752369-081 20 Rank: 2 21 Configured Clock Speed: 2133 MHz 22 Minimum Voltage: 1.2 V 23 Maximum Voltage: 1.2 V 24 Configured Voltage: 1.2 V
(2)最大支持多少内存
[root@Master ~]# dmidecode|grep -P 'Maximum\s+Capacity'

(3)Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:

(4)Linux 查看内存的频率:
[root@Master ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'

(5)Linux 查看内存的详细信息:
1[root@Master ~]# cat /proc/meminfo |head -20 2MemTotal: 131897620 kB 3MemFree: 414124 kB 4Buffers: 1040560 kB 5Cached: 111083180 kB 6SwapCached: 1320 kB 7Active: 7637912 kB 8Inactive: 110607108 kB 9Active(anon): 4406900 kB 10Inactive(anon): 1714900 kB 11Active(file): 3231012 kB 12Inactive(file): 108892208 kB 13Unevictable: 10878976 kB 14Mlocked: 5521652 kB 15SwapTotal: 16777212 kB 16SwapFree: 16737536 kB 17Dirty: 180 kB 18Writeback: 0 kB 19AnonPages: 16999324 kB 20Mapped: 149020 kB 21Shmem: 172 kB
(6)Linux 查看内存的使用情况
1[root@Master ~]# free -m // -b,-k,-m,-g show output in bytes, KB, MB, or GB 2 total used free shared buffers cached 3Mem: 128806 123407 5398 0 1015 103474 4-/+ buffers/cache: 18918 109888 5Swap: 16383 38 16345
**四、查看硬盘信息
**(1)查看挂接的分区状态
[root@Master ~]# fdisk -l |grep Disk

(2)查看硬盘和分区分布
1[root@Master ~]# lsblk 2NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 3sda 8:0 0 279.4G 0 disk 4├─sda1 8:1 0 50M 0 part /boot 5├─sda2 8:2 0 100G 0 part / 6├─sda3 8:3 0 50G 0 part /home 7├─sda4 8:4 0 1K 0 part 8├─sda5 8:5 0 16G 0 part [SWAP] 9├─sda6 8:6 0 13.3G 0 part /tmp 10└─sda7 8:7 0 100G 0 part /usr 11sdb 8:16 0 83.7T 0 disk 12└─sdb1 8:17 0 83.7T 0 part /PureDisk
(3)查看硬盘和分区的详细信息
1[root@Master ~]# fdisk -l 2 3Disk /dev/sda: 300.0 GB, 299966445568 bytes 4255 heads, 63 sectors/track, 36468 cylinders 5Units = cylinders of 16065 * 512 = 8225280 bytes 6Sector size (logical/physical): 512 bytes / 512 bytes 7I/O size (minimum/optimal): 262144 bytes / 262144 bytes 8Disk identifier: 0x000384d9 9 10 Device Boot Start End Blocks Id System 11/dev/sda1 * 1 7 51200 83 Linux 12Partition 1 does not end on cylinder boundary. 13/dev/sda2 7 13061 104857600 83 Linux 14/dev/sda3 13061 19588 52428800 83 Linux 15/dev/sda4 19588 36469 135597056 5 Extended 16/dev/sda5 19588 21677 16777216 82 Linux swap / Solaris 17/dev/sda6 21677 23415 13962240 83 Linux 18/dev/sda7 23416 36469 104854528 83 Linux 19 20WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. 21 22 23Disk /dev/sdb: 92017.3 GB, 92017310654464 bytes 24255 heads, 63 sectors/track, 11187134 cylinders 25Units = cylinders of 16065 * 512 = 8225280 bytes 26Sector size (logical/physical): 512 bytes / 512 bytes 27I/O size (minimum/optimal): 262144 bytes / 6029312 bytes 28Disk identifier: 0x00000000 29 30 Device Boot Start End Blocks Id System 31/dev/sdb1 1 267350 2147483647+ ee GPT 32Partition 1 does not start on physical sector boundary.
(4)查看挂接的分区状态
1[root@Master ~]# mount | column -t 2/dev/sda2 on / type ext4 (rw) 3proc on /proc type proc (rw) 4sysfs on /sys type sysfs (rw) 5devpts on /dev/pts type devpts (rw,gid=5,mode=620) 6tmpfs on /dev/shm type tmpfs (rw) 7/dev/sda1 on /boot type ext4 (rw) 8/dev/sda3 on /home type ext4 (rw) 9/dev/sda6 on /tmp type ext4 (rw) 10/dev/sda7 on /usr type ext4 (rw) 11/dev/sdb1 on /PureDisk type ext4 (rw) 12none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw
(5)查看挂接的分区状态
1[root@Master ~]# swapon -s 2Filename Type Size Used Priority 3/dev/sda5 partition 16777212 39676 -1
(6)查看硬盘使用情况
1[root@Master ~]# df -hT 2Filesystem Type Size Used Avail Use% Mounted on 3/dev/sda2 ext4 99G 561M 93G 1% / 4tmpfs tmpfs 63G 76K 63G 1% /dev/shm 5/dev/sda1 ext4 45M 38M 4.9M 89% /boot 6/dev/sda3 ext4 50G 52M 47G 1% /home 7/dev/sda6 ext4 13G 34M 13G 1% /tmp 8/dev/sda7 ext4 99G 21G 73G 23% /usr 9/dev/sdb1 ext4 84T 41T 40T 51% /PureDisk
(7) 硬盘检测命令smartctl
1[root@Master ~]# smartctl -a /dev/sda 2smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-642.el6.x86_64] (local build) 3Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net 4 5Vendor: HP 6Product: LOGICAL VOLUME 7Revision: 3.56 8User Capacity: 299,966,445,568 bytes [299 GB] 9Logical block size: 512 bytes 10Logical Unit id: 0x600508b1001cc8a1b9ec4dacc5ab35dc 11Serial number: PDNNK0BRH9U0AG 12Device type: disk 13Local Time is: Mon Feb 5 13:13:33 2018 CST 14Device supports SMART and is Enabled 15Temperature Warning Disabled or Not Supported 16SMART Health Status: OK 17 18Error Counter logging not supported 19Device does not support Self Test logging
**五、查看网卡信息
**
(1)查看网卡硬件信息
[root@Master ~]# lspci | grep -i 'eth'

(2)查看系统的所有网络接口
1[root@Master ~]# ifconfig -a 2[root@Master ~]# ip link show
(3)查看某个网络接口的详细信息,例如eth0的详细参数和指标
1[root@Master ~]# ethtool eth0 2Settings for eth0: 3 Supported ports: [ FIBRE ] 4 Supported link modes: 10000baseT/Full 5 Supported pause frame use: No 6 Supports auto-negotiation: No 7 Advertised link modes: 10000baseT/Full 8 Advertised pause frame use: No 9 Advertised auto-negotiation: No 10 Speed: 10000Mb/s 11 Duplex: Full 12 Port: FIBRE 13 PHYAD: 0 14 Transceiver: external 15 Auto-negotiation: off 16 Supports Wake-on: d 17 Wake-on: d 18 Current message level: 0x00000007 (7) 19 drv probe link 20 Link detected: yes
(4)查看所有网卡的链路状态
1[root@Master ~]# for i in `seq 0 9`;do ethtool eth${i} | egrep 'eth|Link';done 2Settings for eth0: 3 Link detected: yes 4Settings for eth1: 5 Link detected: yes 6Settings for eth2: 7 Link detected: no 8Settings for eth3: 9 Link detected: no 10Settings for eth4: 11 Link detected: no 12Settings for eth5: 13 Link detected: no 14Settings for eth6: 15 Link detected: no 16Settings for eth7: 17 Link detected: no 18Settings for eth8: 19 Link detected: no 20Settings for eth9: 21 Link detected: no
**六、列出所有PCI设备信息
**
1[root@Master ~]# lspci -tv | more 2-+-[0000:ff]-+-08.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0 3 | +-08.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0 4 | +-09.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1 5 | +-09.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1 6 | +-0b.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring 7 | +-0b.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring 8 | +-0b.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring 9 | +-0c.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 10 | +-0c.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 11 | +-0c.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 12 | +-0c.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 13 | +-0c.4 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 14 | +-0c.5 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 15 | +-0c.6 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 16 | +-0c.7 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 17 | +-0d.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 18 | +-0d.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers 19 | +-0f.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent 20 | +-0f.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent 21 | +-0f.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent 22 | +-0f.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent