【Linux】管理服务器硬件配置信息的常用命令

网友投稿 783 2022-05-29

lshw可以查看服务器硬件配置的详细信息,可以在支持DMI的x86或者IA-64系统以及power PC 机器上打印内存配置,固件版本,主板配置,cpu版本,cpu频次,缓存,总线速度等信息。

[root@ecs-c13b ~]# lshw -help Hardware Lister (lshw) - B.012.18 usage: lshw [-format] [-options ...] lshw -version -version print program version (B.012.18)(查看版本信息) format can be -html output hardware tree as HTML (将设备树输出信息保存为HTML格式) -xml output hardware tree as XML (保存为XML格式) -json output hardware tree as a JSON object (保存为json格式) -short output hardware paths (输出简短显示硬件路径的设备树信息) -businfo output bus information (输出总线信息的设备列表) options can be -dump OUTFILE save hardware tree to a file -class CLASS only show a certain class of hardware -C CLASS same as '-class CLASS' -c CLASS same as '-class CLASS' -disable TEST disable a test (like pci, isapnp, cpuid, etc. )(禁用某些检测) -enable TEST enable a test (like pci, isapnp, cpuid, etc. ) -quiet don't display status (不显示状态) -sanitize sanitize output (remove sensitive information like serial numbers, etc.) (从输出信息中删除可能敏感的信息,如IP地址,序列号) -numeric output numeric IDs (for PCI, USB, etc.) (显示数字ID) -notime exclude volatile attributes (timestamps) from output [root@ecs-c13b ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

其中:

enable/disable 启用或者禁用某项检测,包括

dmi : 用于DMI/SMBIOS扩展

spd : 用户内存串行存在检测

memory: 用于内存大小猜测启发式

cpuid: 用于cpu检测

usb: 用于USB设备

network: 用于网络接口检测

lsblk查看磁盘的设备名称和容量的对应关系

[root@ecs-c13b ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 253:0 0 40G 0 disk └─vda1 253:1 0 40G 0 part /

1

2

3

4

[root@ecs-c13b ~]# ip addr 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether fa:16:3e:5a:31:dd brd ff:ff:ff:ff:ff:ff inet 192.168.0.192/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0 valid_lft 57710sec preferred_lft 57710sec inet6 fe80::f816:3eff:fe5a:31dd/64 scope link valid_lft forever preferred_lft forever

1

2

3

4

5

6

7

8

9

10

11

12

13

14

[root@ecs-c13b ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 253:0 0 40G 0 disk └─vda1 253:1 0 40G 0 part / [root@ecs-c13b ~]# ip addr 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether fa:16:3e:5a:31:dd brd ff:ff:ff:ff:ff:ff inet 192.168.0.192/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0 valid_lft 57710sec preferred_lft 57710sec inet6 fe80::f816:3eff:fe5a:31dd/64 scope link valid_lft forever preferred_lft forever [root@ecs-c13b ~]# 使用lshw命令可以生成一个详尽的HTML格式文件,使用浏览器打开之后更容易查看到设备型号信息。 [root@ecs-c13b ~]# lshw -short H/W path Device Class Description ===================================================== system OpenStack Nova /0 bus Motherboard /0/0 memory 96KiB BIOS 内存 /0/400 processor Intel(R) Xeon(R) Gold 6266C CPU @ 3.00GHz (CPU型号) /0/1000 memory 4GiB System Memory /0/1000/0 memory 4GiB DIMM RAM /0/100 bridge 440FX - 82441FX PMC [Natoma] /0/100/1 bridge 82371SB PIIX3 ISA [Natoma/Triton II] /0/100/1.1 storage 82371SB PIIX3 IDE [Natoma/Triton II] /0/100/1.2 bus 82371SB PIIX3 USB [Natoma/Triton II] /0/100/1.2/1 usb1 bus UHCI Host Controller /0/100/1.2/1/1 input QEMU USB Tablet /0/100/1.3 bridge 82371AB/EB/MB PIIX4 ACPI /0/100/2 display GD 5446 /0/100/3 network Virtio network device /0/100/3/0 eth0 network Ethernet interface /0/100/4 bridge QEMU PCI-PCI bridge /0/100/5 bridge QEMU PCI-PCI bridge /0/100/5/1 storage Virtio block device /0/100/5/1/0 /dev/vda disk 42GB Virtual I/O device /0/100/5/1/0/1 /dev/vda1 volume 39GiB EXT4 volume /0/100/6 bridge QEMU PCI-PCI bridge /0/100/7 bridge QEMU PCI-PCI bridge /0/100/8 bridge QEMU PCI-PCI bridge /0/100/9 bridge QEMU PCI-PCI bridge /0/100/a bridge QEMU PCI-PCI bridge /0/100/b bridge QEMU PCI-PCI bridge /0/100/c communication Virtio console /0/100/c/0 generic Virtual I/O device /0/100/d generic Virtio memory balloon /0/100/d/0 generic Virtual I/O device /0/1 system PnP device PNP0b00 /0/2 input PnP device PNP0303 /0/3 input PnP device PNP0f13 /0/4 storage PnP device PNP0700 /0/5 communication PnP device PNP0501 [root@ecs-c13b ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

【Linux】管理服务器硬件配置信息的常用命令

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

linux

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:深入JVM-虚拟机运行时内存
下一篇:【手摸手学ModelArts】两行命令获取ModelArts正版实战教程
相关文章