如何在Linux中检查硬件组件的状态?

如何在Linux中检查硬件组件的状态?

lshw我知道像和 之类的命令dmidecode,但它们所做的只是列出检测到的硬件属性,对吗?我可以获得有关计算机硬件的所有信息。

但我还想检查已检测到的设备是否正常工作。

flathub...hw-probe来自 flatpak 完成这项工作,但它将信息转储到其在线数据库/存储库中。  就是一个例子。

有什么方法可以离线保存它或将其输出重定向到我喜欢的其他地方吗?

有没有什么工具可以离线完成同样的工作?

答案1

您不需要将结果上传到Linux硬件DB;使用-show-verbose选项,然后将结果本地保存到file

sudo -E hw-probe -probe
sudo hw-probe --show --verbose > file
less file

man hw-probe

-show
   Show devices info.
-verbose
   Use with -show option to show type and status of the device.

答案2

当然可以,使用

$ sudo hw-probe -get-inventory-id -email ADDR
Inventory ID: INVENTORYID

$ sudo -E hw-probe -all -upload -inventory-id INVENTORYID
Probe for hardware ... Ok
Reading logs ... Ok
Uploaded to DB, Thank you!

Probe URL: https://linux-hardware.org/?probe=PROBEID

WARNING: You'll get a letter soon to confirm new node.

$ sudo hw-probe -import ./DIR -i INVENTORYID
Computer COMPUTERID
Importing probe PROBEID
Created index: ./DIR/index.html

答案3

安装perl-JSON-XS包然后:

sudo -E hw-probe -all
sudo cat /root/HW_PROBE/LATEST/hw.info/devices.json

在输出中查看计算设备状态:

"pci:10de-0dfc-1028-1535" : {
  "Bus" : "PCI",
  "Class" : "03-00",
  "Device" : "GF108GLM [NVS 5200M]",
  "Driver" : "nouveau",
  "SVendor" : "Dell",
  "Status" : "works",
  "Type" : "graphics card",
  "Vendor" : "NVIDIA Corporation"
},
"pci:1217-8221-1028-0535" : {
  "Bus" : "PCI",
  "Class" : "08-05-01",
  "Device" : "OZ600FJ0/OZ900FJ0/OZ600FJS SD/MMC Card Reader Controller",
  "Driver" : "sdhci_pci",
  "SVendor" : "Dell",
  "Status" : "detected",
  "Type" : "sd host controller",
  "Vendor" : "O2 Micro, Inc."
},
...

相关内容