基礎命令學習目錄首頁html
轉載自系統技術非業餘研究linux
本文連接地址: hwconfig查看硬件信息ios
最近常常要測試新硬件,瞭解硬件的具體型號和參數就很是重要,過去常常透過lspci, dmidecode, dmesg, ethtool, lshal, megacli等命令和各類/proc信息來了解,須要對這些工具很熟悉, 貌似比較不方便和準確。less
今天看到某同窗用的hwconfig感受信息很專業,推薦給你們。這裏能夠下載, 感謝微博@frostwatcher同窗.ide
hwconfig透過收集上面提到的各類信息, 而後根據wiki或者廠家公佈的設備識別碼, 進一步加工,給用戶一個直觀的信息.wordpress
不廢話,效果以下:工具
usage: hwconfig [-dhnv] [-t timeout] [-r file ] [-x file ] [-o file ] |
-d show debugging information |
-n don't break output lines |
-o write output to file (- for stdout) |
-r write raw source to file (- for stdout) |
-t abort after timeout seconds |
-x write xml to file (- for stdout) |
hwconfig: warning: could not run megarc; please yinst megarc |
Summary: Huawei Technologies Tecal RH2285, 2 x Xeon E5620 2.40GHz, 23.5GB / 24GB 1066MHz |
System: Huawei Technologies Tecal RH2285 (Huawei Technologies BC11BTSA) |
Processors: 2 x Xeon E5620 2.40GHz 133MHz FSB (16 cores) |
Memory: 23.5GB / 24GB 1066MHz == 6 x 4GB, 6 x empty |
Disk: sda (megaraid_sas0): 107GB (38%) JBOD == 1 x LSI-MegaRAID-SAS-RMB |
Disk: sdb (megaraid_sas0): 5.9TB (1%) JBOD == 1 x LSI-MegaRAID-SAS-RMB |
Disk-Control: megaraid_sas0: LSI Logic / Symbios Logic MegaRAID SAS 1078 |
Disk-Control: ata_piix0: Intel 82801JI (ICH10 Family) 4 port SATA IDE Controller |
Disk-Control: ata_piix1: Intel 82801JI (ICH10 Family) 2 port SATA IDE Controller |
Network: host5 (bnx2-1): Broadcom NetXtreme II BCM5709 Gigabit Ethernet |
Network: host6 (bnx2-0): Broadcom NetXtreme II BCM5709 Gigabit Ethernet |
Network: eth0 (bnx2): 08:19:a6:24:3c:05, 1000Mb/s <full-duplex> |
Network: eth1 (bnx2): 08:19:a6:24:3c:05, 1000Mb/s <full-duplex> |
OS: RHEL Server 5.4 (Tikanga), Linux 2.6.18-164.el5 x86_64, 64-bit |
BIOS: AMI CTSAV035 12/07/2010 |
$ sudo hwconfig -x cfg.xml |
<system code_version= "1.16.7" hostname = "dr4000" timestamp= "1331966816" xml_version= "1.0.1" > |
<base_board manufacturer= "Dell Inc." model= "084YMW" serial= "..CN137401C800C9." version= "A05" /> |
<bios date = "10/21/2011" manufacturer= "Dell Inc." pretty= "Dell 1.9.0 10/21/2011" rev= "1.9" version= "1.9.0" /> |
<chipsets summary= "Intel 5500 IOH-24D B3 (Tylersburg), 82801JIR A0 (ICH10R)" > |
<chipset handle= "56" model= "5500 IOH-24D" name= "Tylersburg" pci= "00:00.0" pci_handle= "1" stepping= "B3" type = "Northbridge" vendor= "Intel" /> |
<chipset handle= "57" model= "82801JIR" name= "ICH10R" pci= "00:1f.0" pci_handle= "19" stepping= "A0" type = "Southbridge" vendor= "Intel" /> |
<volume controller= "scsi0" drive_write_cache= "default" handle= "75" name= "sda" raid= "RAID-0" read_ahead= "adaptive" size= "598879502336" spans= "1" status= "ok" stripe= "65536" > |
<read_cache enable = "0" /> |
<write_cache enable = "0" policy= "write-back" /> |
<system manufacturer= "Dell Inc." model= "Dell DR4000" pretty= "Dell DR4000" serial= "8MCBB3X" uuid= "4C4C4544-004D-4310-8042-B8C04F423358" version= "" /> |
看着信息仍是很專業的,結果微博上有同窗反映是個腳本,我看了下原來hwconfig真的是個腳本:post
$ENV{PATH} = "/etc/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/home/opt:/opt/MegaRAID/MegaCli:/usr/StorMan" ; |
$ cat ` which hwconfig `| wc -l |
挺佩服這幫人的,腳本也能有這樣的耐心,寫這麼長。性能
祝你們玩得開心!學習