当前位置:   article > 正文

查看服务器硬件配置信息

idrac查看硬盘型号

本次由于需要搭建一套环境,但是所需硬件配置不足,需要进行统计采购。那么就需要得知服务器现有配置,所以这次会介绍些常用的命令和工具来查询硬件信息。其实也可以通过像DELL厂商的IDRAC控制台来获取这些信息,但是比较尴尬的是IBM在获取硬盘信息方面支持比较差,仅显示物理磁盘数量,能够获取的信息很少,这时就需要像storcli这种专业工具来收集。本章使用的命令查询需求比较单一,后续会在实际使用中慢慢补充上来。

一、查看服务器对应 IPMI 地址

[root@node-1 ~]# ipmitool lan print

  1. Set in Progress : Set Complete
  2. Auth Type Support : NONE MD2 MD5 PASSWORD
  3. Auth Type Enable : Callback :
  4. : User : MD2 MD5 PASSWORD
  5. : Operator : MD2 MD5 PASSWORD
  6. : Admin : MD2 MD5 PASSWORD
  7. : OEM :
  8. IP Address Source : Static Address
  9. IP Address : 10.100.0.40
  10. Subnet Mask : 255.255.255.0
  11. MAC Address : 40:f2:e9:da:53:fe
  12. SNMP Community String : public
  13. IP Header : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
  14. BMC ARP Control : ARP Responses Enabled, Gratuitous ARP Disabled
  15. Gratituous ARP Intrvl : 2.0 seconds
  16. Default Gateway IP : 10.100.0.1
  17. Default Gateway MAC : 00:00:00:00:00:00
  18. Backup Gateway IP : 0.0.0.0
  19. Backup Gateway MAC : 00:00:00:00:00:00
  20. 802.1q VLAN ID : Disabled
  21. 802.1q VLAN Priority : 0
  22. RMCP+ Cipher Suites : 1,2,3,4,5,6,7,8,9,10,11,12,13,14
  23. Cipher Suite Priv Max : aaaaaaaaaaaaaaX
  24. : X=Cipher Suite Unused
  25. : c=CALLBACK
  26. : u=USER
  27. : o=OPERATOR
  28. : a=ADMIN
  29. : O=OEM
二、查看网卡速率

[root@node-1 ~]# lspci | grep Ethernet #列出每个pci总线上的设备,通过grep过滤可得到网卡设备列表,这里看到总计8个网卡

  1. 06:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
  2. 06:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
  3. 06:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
  4. 06:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
  5. 11:00.0 Ethernet controller: Broadcom Limited NetXtreme II BCM57810 10 Gigabit Ethernet (rev 10)
  6. 11:00.1 Ethernet controller: Broadcom Limited NetXtreme II BCM57810 10 Gigabit Ethernet (rev 10)
  7. 20:00.0 Ethernet controller: Broadcom Limited NetXtreme II BCM57810 10 Gigabit Ethernet (rev 10)
  8. 20:00.1 Ethernet controller: Broadcom Limited NetXtreme II BCM57810 10 Gigabit Ethernet (rev 10)

[root@node-1 ~]# ethtool eth0 #查看单块网卡的详细信息

  1. Settings for eth0:
  2. Supported ports: [ TP ] #TP 代表是千兆网卡
  3. Supported link modes: 10baseT/Half 10baseT/Full
  4. 100baseT/Half 100baseT/Full
  5. 1000baseT/Full
  6. Supported pause frame use: Symmetric
  7. Supports auto-negotiation: Yes
  8. Advertised link modes: 10baseT/Half 10baseT/Full
  9. 100baseT/Half 100baseT/Full
  10. 1000baseT/Full
  11. Advertised pause frame use: Symmetric
  12. Advertised auto-negotiation: Yes
  13. Speed: 1000Mb/s
  14. Duplex: Full
  15. Port: Twisted Pair
  16. PHYAD: 1
  17. Transceiver: internal
  18. Auto-negotiation: on
  19. MDI-X: on (auto)
  20. Supports Wake-on: pumbg
  21. Wake-on: g
  22. Current message level: 0x00000007 (7)
  23. drv probe link
  24. Link detected: yes

[root@node-1 ~]# ethtool eth1

  1. Settings for eth1:
  2. Supported ports: [ FIBRE ] #FIBRE 代表是万兆网卡
  3. Supported link modes: 1000baseT/Full
  4. 10000baseT/Full
  5. Supported pause frame use: Symmetric Receive-only
  6. Supports auto-negotiation: No
  7. Advertised link modes: 10000baseT/Full
  8. Advertised pause frame use: No
  9. Advertised auto-negotiation: No
  10. Speed: Unknown!
  11. Duplex: Unknown! (255)
  12. Port: FIBRE
  13. PHYAD: 1
  14. Transceiver: internal
  15. Auto-negotiation: off
  16. Supports Wake-on: g
  17. Wake-on: d
  18. Current message level: 0x00000000 (0)
  19. Link detected: no
三、查看内存信息

[root@node-1 ~]# cat /proc/meminfo
[root@node-1 ~]# dmidecode -t memory #此命令会列出每条内存的型号、频率等详细信息

  1. Handle 0x000A, DMI type 17, 34 bytes
  2. Memory Device
  3. Array Handle: 0x0009
  4. Error Information Handle: Not Provided
  5. Total Width: 72 bits
  6. Data Width: 64 bits
  7. Size: 8192 MB
  8. Form Factor: DIMM
  9. Set: 1
  10. Locator: DIMM 1
  11. Bank Locator: Bank 1
  12. Type: DDR3
  13. Type Detail: Registered (Buffered)
  14. Speed: 1333 MHz
  15. Manufacturer: Samsung
  16. Serial Number: 3386DA95
  17. Asset Tag: Unknown
  18. Part Number: M393B1K70DH0-YH9
  19. Rank: 2
  20. Configured Clock Speed: 1333 MHz
四、使用 storcli 查看服务器硬件基础信息

[root@node-1 ~]# rpm -ivh storcli-1.18.05-1.noarch.rpm #安装包请见文章末尾
[root@node-1 ~]# /opt/MegaRAID/storcli/storcli64 show all #查询所有信息并show,在system overview下看到controller(缩写ctl)列数字就是controller号,得知node-1这台机器的controller号是0

  1. System Overview :
  2. ===============
  3. ---------------------------------------------------------------------------
  4. Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs Hlth
  5. ---------------------------------------------------------------------------
  6. 0 ServeRAIDM5110e 8 7 5 0 5 0 Opt On - Y 3 Opt
  7. ---------------------------------------------------------------------------

[root@node-1 ~]# /opt/MegaRAID/storcli/storcli64 /c0 show #显示contrller0的raid卡的版本、功能、状态、以及raid卡下的物理磁、逻辑盘信息,这里我需要看物理磁盘的容量情况,可以在PD LIST部分找到

如果不需要其他信息,和我一样只需要知道物理磁盘信息的话可以使用如下命令
[root@node-1 ~]# /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show

  1. Controller = 0
  2. Status = Success
  3. Description = Show Drive Information Succeeded.
  4. Drive Information :
  5. =================
  6. -------------------------------------------------------------------------
  7. EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
  8. -------------------------------------------------------------------------
  9. 252:0 20 Onln 1 278.464 GB SAS HDD N N 512B MK3001GRRB U
  10. 252:1 15 Onln 1 278.464 GB SAS HDD N N 512B ST9300603SS F U
  11. 252:2 16 Onln 0 557.861 GB SAS HDD N N 512B MBF2600RC U
  12. 252:3 17 Onln 0 557.861 GB SAS HDD N N 512B MBF2600RC U
  13. 252:4 19 Onln 2 557.861 GB SAS HDD N N 512B MBF2600RC U
  14. 252:5 14 Onln 3 557.861 GB SAS HDD N N 512B MBF2600RC U
  15. 252:6 18 Onln 4 557.861 GB SAS HDD N N 512B MBF2600RC U
  16. -------------------------------------------------------------------------
五、不想安装 storcli 的情况下查看硬盘型号信息

[root@node-1 ~]# cat /proc/scsi/scsi|grep 'Model:' #node-1 是 IBM X3650 M4

  1. Vendor: IBM Model: ServeRAID M5110e Rev: 3.34
  2. Vendor: IBM Model: ServeRAID M5110e Rev: 3.34
  3. Vendor: IBM Model: ServeRAID M5110e Rev: 3.34
  4. Vendor: IBM Model: ServeRAID M5110e Rev: 3.34
  5. Vendor: IBM Model: ServeRAID M5110e Rev: 3.34
  6. Vendor: IBM SATA Model: DEVICE 81Y3682 Rev: D001

[root@node-5 ~]# cat /proc/scsi/scsi|grep 'Model:' #node-5 是 DELL R720,ST1000NM0023就是硬盘的型号

  1. Vendor: SEAGATE Model: ST1000NM0023 Rev: GS0D
  2. Vendor: SEAGATE Model: ST1000NM0023 Rev: GS0D
  3. Vendor: SEAGATE Model: ST1000NM0023 Rev: GS0F
  4. Vendor: SEAGATE Model: ST1000NM0023 Rev: GS0D

这种方式在硬盘做 raid 后不便于查看,例如下面查看我另一台服务器所看到到的,显示只有一块磁盘设备
[root@node-1 ~]# cat /proc/scsi/scsi|grep 'Model:'

  1. Vendor: DELL Model: PERC H710 Rev: 3.13
  2. Vendor: TSSTcorp Model: DVD-ROM SN-108FB Rev: D150

接下来通过 lsblk 查看设备情况,发现这块盘总容量2.7T(我这里使用的盘是1T的SAS盘,可以倒推出是4块1T盘组成的raid5)正好对应上我在IDRAC界面中看到的四块物理磁盘
[root@node-1 ~]# lsblk

  1. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  2. sda 8:0 0 2.7T 0 disk
  3. ├─sda1 8:1 0 24M 0 part
  4. ├─sda2 8:2 0 200M 0 part
  5. ├─sda3 8:3 0 250M 0 part /boot
  6. ├─sda4 8:4 0 1.4T 0 part
  7. │ ├─os-root 253:0 0 1.4T 0 lvm /
  8. │ └─os-swap 253:1 0 32G 0 lvm [SWAP]
  9. └─sda5 8:5 0 1.3T 0 part
  10. └─mongo-mongodb 253:2 0 1.3T 0 lvm /var/lib/mongo
  11. sr0 11:0 1 1024M 0 rom

1524426-20190107125446155-26487821.png
1524426-20190107125452256-464030198.png


storcli安装包各平台百度网盘链接地址(可在官网下载 https://www.broadcom.com/site-search?q=storcli)
链接:https://pan.baidu.com/s/19liM1WMaY7XoNIHLrX1dKg
提取码:pu7n


续:在检查过程中发现IBM服务器上有两块disk告警,联系维保需要提供FRU号,但是人又不在现场没办法拔盘拍照。所以需要通过storcli来查询盘对应FRU号。

六、查询硬盘FRU号

[root@node-2 ~]# /opt/MegaRAID/storcli/storcli64 -PDList -aAll | grep FRU #如果想查看具体信息可以去掉过滤条件

  1. IBM FRU/CRU: 42D0638
  2. IBM FRU/CRU: 49Y2023
  3. IBM FRU/CRU: 49Y2004
  4. IBM FRU/CRU: 49Y2023
  5. IBM FRU/CRU: 49Y2004
  6. IBM FRU/CRU: 49Y2023

从上可以看到有两对重复的FRU号,怀疑可能是组成raid,那么就要通过storcli查看下硬盘raid情况

(1)查看逻辑磁盘
[root@node-2 ~]# /opt/MegaRAID/storcli/storcli64 /c0/vall show #这里看到有5块逻辑磁盘,通过 /c0 show 命令查看物理磁盘发现有6块,继续向下查看硬盘 raid 情况。

  1. Controller = 0
  2. Status = Success
  3. Description = None
  4. Virtual Drives :
  5. ==============
  6. ----------------------------------------------------------------------
  7. DG/VD TYPE  State Access Consist Cache Cac sCC       Size Name        
  8. ----------------------------------------------------------------------
  9. 0/0   RAID1 Optl  RW     Yes     RWBD  -   ON  557.861 GB             
  10. 1/1   RAID0 Optl  RW     Yes     RWBD  -   ON  557.861 GB             
  11. 2/2   RAID0 Optl  RW     Yes     RWBD  -   ON  557.861 GB             
  12. 3/3   RAID0 Optl  RW     Yes     RWBD  -   ON  557.861 GB             
  13. 4/4   RAID0 Optl  RW     Yes     RWBD  -   ON  278.464 GB GenericR0_4
  14. ----------------------------------------------------------------------
  15. Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
  16. Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
  17. Consist=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
  18. AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
  19. Check Consistency

(2)查看逻辑磁盘大小、raid结构
[root@node-2 ~]# /opt/MegaRAID/storcli/storcli64 /c0/v0 show #可以看到 TYPE 为 RAID1,两块 600G 盘做的 RAID1,正好能够对上6块物理磁盘

  1. Controller = 0
  2. Status = Success
  3. Description = None
  4. Virtual Drives :
  5. ==============
  6. ---------------------------------------------------------------
  7. DG/VD TYPE  State Access Consist Cache Cac sCC       Size Name
  8. ---------------------------------------------------------------
  9. 0/0   RAID1 Optl  RW     Yes     RWBD  -   ON  557.861 GB      
  10. ---------------------------------------------------------------
  11. Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
  12. Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
  13. Consist=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
  14. AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
  15. Check Consistency

[root@node-2 ~]# /opt/MegaRAID/storcli/storcli64 /c0/v1 show #可以看到 TYPE 为 RAID0

  1. Controller = 0
  2. Status = Success
  3. Description = None
  4. Virtual Drives :
  5. ==============
  6. ---------------------------------------------------------------
  7. DG/VD TYPE  State Access Consist Cache Cac sCC       Size Name
  8. ---------------------------------------------------------------
  9. 1/1   RAID0 Optl  RW     Yes     RWBD  -   ON  557.861 GB      
  10. ---------------------------------------------------------------
  11. Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
  12. Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
  13. Consist=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
  14. AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
  15. Check Consistency

依次查看 /c0/v0……4,结果为 v0 raid1 其余四个逻辑磁盘均为 raid0

转载于:https://www.cnblogs.com/puppet/p/10232263.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/867519
推荐阅读
相关标签
  

闽ICP备14008679号