Linux查看硬件信息

Linux查看硬件信息

查看服务器型号、序列号

dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"

查看主板型号

dmidecode |grep -A16 "System Information$" 

查看BIOS信息

dmidecode -t bios

查看内存槽及内存条

dmidecode -t memory

查看网卡信息

dmesg | grep -i Ethernet
ethtool enp94s0
lspci | grep Ethernet

查看CPU信息
查看cpu型号

cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

查看系统中实际物理CPU的数量

grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l

系统中逻辑CPU的数量(核数)

cat /proc/cpuinfo |grep 'processor'|wc -l

查看单颗物理CPU核数
查看CPU的主频

cat /proc/cpuinfo |grep MHz|uniq

最大支持多少内存

dmidecode|grep -P 'Maximum\s+Capacity

查看nvme硬盘信息

yum install nvme-cli
  1. 显示NVMe设备列表
sudo nvme list

该命令将显示系统中所有的NVMe设备列表,包括设备名称、序列号、容量等信息。
2. 查看NVMe设备信息

sudo nvme show /dev/nvmeX

将/dev/nvmeX替换为实际的NVMe设备名称(如/dev/nvme0n1),该命令将显示指定NVMe设备的详细信息,包括固件版本、命名空间等。
3. 检测NVMe设备状态

sudo nvme smart-log /dev/nvmeX

该命令将显示指定NVMe设备的SMART(Self-Monitoring, Analysis and Reporting Technology)日志,用于检测设备的健康状态和性能。
4. 测试NVMe设备性能

sudo nvme speed-test /dev/nvmeX

该命令将对指定NVMe设备进行性能测试,包括读取和写入速度
查看硬盘SN

smartctl -d scsi -a /dev/sda | grep -i Serial

阵列查看硬盘SN

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL

** # 查看所有阵列卡上的所有物理硬盘信息,包括型号、接口、SN码、部分SMART信息等**

bat统计硬件信息的,同时写入共享的同个文件

@echo off
@hostname >C:\host
set /p hostname=<C:\host
@hostname >>\\10.10.100.111\test\%hostname%
wmic diskdrive get SystemName,InterfaceType,model,serialnumber|findstr SCSI >>\\10.10.100.111\test\%hostname%
del C:\host

查看内存SN

wmic memorychip get devicelocator,partnumber,manufacturer,serialnumber

查看硬盘SN

wmic diskdrive get SystemName,InterfaceType,model,serialnumber|findstr IDE >>\\10.10.100.111\d$\log\test\ideinfo

查看硬盘大小

wmic  logicaldisk where "Caption='D:'" get SystemName,name,freespace,size>>\\10.10.100.111\d\zq\dspace.txt

wmic path win32_physicalmedia where "Tag like '%PHYSICALDRIVE2%'" get SerialNumber
@echo off
 for /f "usebackq tokens=2 delims==," %%G in (`wmic os get csname /value`) do set "COMPUTERNAME=%%G" for /f "usebackq skip=1 tokens=2 delims==," %%G in (`wmic path win32_physicalmedia where "Tag like '%%PHYSICALDRIVE2%%'" get SerialNumber /value`) do set "SERIALNUMBER=%%G" echo %COMPUTERNAME%, %SERIALNUMBER% >> output.txt
@echo off for /f "usebackq tokens=2 delims==," %%G in (`wmic os get csname /value`) do set "OUTPUT_FILE=%%G.txt" for /f "usebackq skip=1 tokens=2 delims==," %%G in (`wmic path win32_physicalmedia where "Tag like '%%PHYSICALDRIVE2%%'" get SerialNumber /value`) do set "SERIALNUMBER=%%G" echo %COMPUTERNAME%, %SERIALNUMBER% >> \\10.10.100.111\d\bat\disk\%OUTPUT_FILE%
posted @ 2024-02-22 12:23  Suixin随心  阅读(152)  评论(0编辑  收藏  举报