查看AIX系統cpu、記憶體、網卡、硬碟、HBA卡資訊命令 查看AIX系統的主機型號、序號、CPU、記憶體、硬碟、網卡、網卡物理插槽位置資訊、是否配置乙太網路通道、網卡鏈路狀態、當前網路速率、HBA卡、HBA卡物理插槽位置資訊、HBA卡WWN、HBA卡支援速率、HBA卡當前速率、VG、PV、LV資訊、該主機當前由哪台HMC管理、配置了多少磁帶機磁碟機 tape driver等資訊,可以通過一段指令碼收集全部資訊。一、查看型號、序號、CPU、記憶體、HMC型號:#uname -MIBM,8204-E8A序號:#uname -uIBM,0206***** CPU數量#lsdev -Cc processorproc0 Available 00-00 Processorproc2 Available 00-02 Processorproc4 Available 00-04 Processorproc6 Available 00-06 Processorproc8 Available 00-08 Processorproc10 Available 00-10 Processorproc12 Available 00-12 Processorproc14 Available 00-14 Processor CPU主頻#lsattr -El proc0frequency 4204000000 Processor Speed Falsesmt_enabled true Processor SMT enabled Falsesmt_threads 2 Processor SMT threads Falsestate enable Processor state Falsetype PowerPC_POWER6 Processor type False 查看CPU是否64位#prtconf -cCPU Type: 64-bit記憶體資訊:#lsattr -El mem0ent_mem_cap I/O memory entitlement in Kbytes Falsegoodsize 63744 Amount of usable physical memory in Mbytes Falsemem_exp_factor Memory expansion factor Falsesize 63744 Total amount of physical memory in Mbytes Falsevar_mem_weight Variable memory capacity weight False查看該機當前由哪台HMC管理#lsrsrc IBM.ManagementServerResource Persistent Attributes for IBM.ManagementServerresource 1:Name= "123.123.123.9"Hostname= "123.123.123.9"ManagerType= "HMC"LocalHostname= "123.123.234.132"ClusterTM= "9078-160"ClusterSNum= ""ActivePeerDomain = ""NodeNameList= {"testdb1"}型號、序號、記憶體統一資訊:#lsattr -El sys0fwversion IBM,EL350_085 Firmware version and revision levels Falsemodelname IBM,8204-E8A Machine name Falserealmem 65273856 Amount of usable physical memory in Kbytes Falsesystemid IBM,0206***** Hardware system identifier False 二、查看磁碟資訊:#lspvhdisk0 00cb01e637be5983 rootvg activehdisk1 00cb01e6dd9045e6 rootvg active #lspathEnabled hdisk0 sas0Enabled hdisk1 sas0Available ses0 sas0Available ses1 sas0列出所有磁碟裝置#lsdev -Cc diskhdisk0 Available 02-08-00 SAS Disk Drivehdisk1 Available 02-08-00 SAS Disk Drive查看磁碟容量#bootinfo -s hdisk0140013查看磁碟屬性#lsattr -El hdisk0reserve_policy no_reserve Reserve Policy Truesize_in_mb 146800 Size in Megabytes False查看磁碟物理插槽資訊#lscfg -vpl hdisk0hdisk0 U78A0.001.DNWK9W6-P2-D3 SAS Disk Drive (146800 MB)Hardware Location Code......U78A0.001.DNWK9W6-P2-D3以上命令適用於現場查看,需要查看哪些硬碟,就執行幾條命令,但是當需要使用者幫忙採集資訊,而系統磁碟數量未知的情況下就難以勝任了,以下指令碼列出本機所有磁碟資訊並對每個磁碟執行bootinfo -s查看磁碟容量,執行lsattr -El查看磁碟屬性、執行lscfg -vpl查看磁碟物理插槽、lspv查看磁碟pv資訊等。 1. echo "#lsdev -Cc disk" 2. lsdev -Cc disk 3. for i in `lsdev -Cc disk|awk '{print $1}'`; 4. do 5. echo "nInformation about "$i "n#bootinfo -s" $i 6. bootinfo -s $i 7. echo "n#lsattr -El" $i 8. lsattr -El $i 9. echo "n#lscfg -vpl " $i 10. lscfg -vpl $i 11. echo "n#lspv " $i 12. lspv $i 13. done 複製代碼三、查看網卡資訊#lsdev -Cc adapter|grep entent0 Available Logical Host Ethernet Port (lp-hea)ent1 Available Logical Host Ethernet Port (lp-hea)ent2 Available 04-00 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)ent3 Available 04-01 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)ent4 Available EtherChannel / IEEE 802.3ad Link Aggregation以上資訊顯示ent4通過乙太網路通道綁定後產生的網卡,執行lsattr -El ent4可以查看ent4由哪些網卡綁定而成,是主備模式、負載平衡模式或者負載平衡+主備模式。#lsattr -El ent4adapter_names ent0 EtherChannel Adapters Trueauto_recovery yes Enable automatic recovery after failover Truebackup_adapter ent2 Adapter used when whole channel fails Truemode standard EtherChannel mode of operation Truenetaddr 0 Address to ping True#lscfg -vpl ent2ent2 U78A0.001.DNWK58T-P1-C1-T1 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)Hardware Location Code......U78A0.001.DNWK58T-P1-C1-T1#lsattr -El en4netaddr 123.123.123.61 Internet Address Truenetmask 255.255.255.128 Subnet Mask Truestate up Current Interface Status True#netstat -in#netstat -rn#ifconfig -a#ifconfig -l查看網卡當前串連狀態、鏈路速率#netstat -v en4 |grep -i SpeedMedia Speed Selected: AutonegotiateMedia Speed Running: 1000 Mbps / 1 Gbps, Full DuplexExternal-Network-Switch (ENS) Port Speed: 1000 Mbps / 1 Gbps, Full DuplexMedia Speed Selected: Auto negotiationMedia Speed Running: 1000 Mbps Full Duplex在網卡數量未知的情況下,可以採用以下指令碼一次性收集所有網卡資訊: 1. echo "#lsdev -Cc adapter|grep ent" 2. lsdev -Cc adapter|grep ent 3. for i in `lsdev -Cc adapter|awk '{print $1}' |grep ent`; 4. do 5. echo "nInformation about "$i "n#lsattr -El" $i 6. lsattr -El $i 7. echo "n#lscfg -vl " $i 8. lscfg -vl $i 9. done 10. for i in `ifconfig -l`; 11. do 12. echo "nInformation about "$i "n#lsattr -El" $i 13. lsattr -El $i 14. echo "n#netstat -v " $i 15. netstat -v $i 16. echo "n#netstat -v " $i "|grep -i Speed" 17. netstat -v $i |grep -i Speed 18. done 複製代碼四、HBA卡資訊#lsdev -Cc adapter|grep fcsfcs0 Available 01-08 FC Adapterfcs1 Available 01-09 FC Adapterfcs2 Available 04-08 FC Adapterfcs3 Available 04-09 FC Adapter#lsattr -El fcs0查看HBA卡的物理插槽、WWN:#lscfg -vpl fcs0fcs0 U78A0.001.DNWK9W6-P1-C4-T1 FC AdapterNetwork Address.............10000000C9B54A92Hardware Location Code......U78A0.001.DNWK9W6-P1-C4-T1以上Network Address即為fcs0的WWN。在HBA卡數量未知的情況下,可以採用以下指令碼一次性收集所有HBA卡的物理插槽、WWN資訊,這點項目中非常經常用到,因為需要收集HBA卡的WWN用於SAN交換器配置ZONE資訊、儲存端也需要WWN用於Mapping LUN: 1. echo "#lsdev -Cc adapter|grep fcs" 2. lsdev -Cc adapter|grep fcs 3. for i in `lsdev -Cc adapter|grep fcs|awk '{print $1}'`; 4. do 5. echo "nInformation about "$i "n#lsattr -El" $i 6. lsattr -El $i 7. echo "n#lscfg -vpl " $i 8. lscfg -vl $i 9. echo "n#fcstat " $i 10. fcstat $i 11. done 複製代碼五、磁帶tape資訊#lsdev -Cc tapermt0 Available 02-08-00 SAS 4mm Tape Drive#lsattr -El rmt0#lscfg -vpl rmt0rmt0 U78A0.001.DNWK9W6-P2-D1 SAS 4mm Tape Drive (80000 MB)Hardware Location Code......U78A0.001.DNWK9W6-P2-D1當主機接了磁帶庫,tape driver數量未知的情況下,可以採用以下指令碼一次性收集所有tape driver資訊: 1. echo "#lsdev -Cc tape" 2. lsdev -Cc tape 3. for i in `lsdev -Cc tape|awk '{print $1}'` 4. do 5. echo "nInformation about "$i "n#lsattr -El" $i 6. lsattr -El $i 7. echo "n#lscfg -vl " $i 8. lscfg -vl $i 9. done 複製代碼六、查看VG、PV、LV資訊查看系統中所有VG#lsvgrootvgvgora查看當前active的VG#lsvg -ovgorarootvg#lsvg -p rootvgrootvg:PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTIONhdisk0 active 558 429 111..68..27..111..112hdisk1 active 558 437 111..76..27..111..112#lsvg -l rootvg查看所有PV#lspvhdisk0 00cb01e637be5983 rootvg activehdisk1 00cb01e6dd9045e6 rootvg active#lspv -l hdisk0當VG數量未知時,可用以下指令碼一次性收集所有VG、LV資訊(可結合上文disk資訊)echo "#lsvg "lsvgecho "#lsvg -o"lsvg -ofor i in `lsvg`;doecho "nInformation about VG "$i "n#lsvg " $ilsvg $iecho "n#lsvg -l " $ilsvg -l $iecho "n#lsvg -p " $ilsvg -p $iecho "n#lsvg -M " $ilsvg -M ${i}done