查看AIX系統cpu、內存、網卡、硬盤、HBA卡信息命令
查看AIX系統的主機型號、序列號、CPU、內存、硬盤、網卡、網卡物理插槽位置信息、是否配置以太網通道、網卡鏈路狀態、當前網絡速率、HBA卡、HBA卡物理插槽位置信息、HBA卡WWN、HBA卡支持速率、HBA卡當前速率、VG、PV、LV信息、該主機當前由哪台HMC管理、配置了多少磁帶機驅動器 tape driver等信息,可以通過一段腳本收集全部信息。
一、查看型號、序列號、CPU、內存、HMC
型號:
#uname -M
IBM,8204-E8A
序列號:
#uname -u
IBM,0206*****
CPU數量
#lsdev -Cc processor
proc0 Available 00-00 Processor
proc2 Available 00-02 Processor
proc4 Available 00-04 Processor
proc6 Available 00-06 Processor
proc8 Available 00-08 Processor
proc10 Available 00-10 Processor
proc12 Available 00-12 Processor
proc14 Available 00-14 Processor
CPU主頻
#lsattr -El proc0
frequency 4204000000 Processor Speed False
smt_enabled true Processor SMT enabled False
smt_threads 2 Processor SMT threads False
state enable Processor state False
type PowerPC_POWER6 Processor type False
查看CPU是否64位
#prtconf -c
CPU Type: 64-bit
內存信息:
#lsattr -El mem0
ent_mem_cap I/O memory entitlement in Kbytes False
goodsize 63744 Amount of usable physical memory in Mbytes False
mem_exp_factor Memory expansion factor False
size 63744 Total amount of physical memory in Mbytes False
var_mem_weight Variable memory capacity weight False
查看該機當前由哪台HMC管理
#lsrsrc IBM.ManagementServer
Resource Persistent Attributes for IBM.ManagementServer
resource 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 sys0
fwversion IBM,EL350_085 Firmware version and revision levels False
modelname IBM,8204-E8A Machine name False
realmem 65273856 Amount of usable physical memory in Kbytes False
systemid IBM,0206***** Hardware system identifier False
二、查看磁盤信息:
#lspv
hdisk0 00cb01e637be5983 rootvg active
hdisk1 00cb01e6dd9045e6 rootvg active
#lspath
Enabled hdisk0 sas0
Enabled hdisk1 sas0
Available ses0 sas0
Available ses1 sas0
列出所有磁盤設備
#lsdev -Cc disk
hdisk0 Available 02-08-00 SAS Disk Drive
hdisk1 Available 02-08-00 SAS Disk Drive
查看磁盤容量
#bootinfo -s hdisk0
140013
查看磁盤屬性
#lsattr -El hdisk0
reserve_policy no_reserve Reserve Policy True
size_in_mb 146800 Size in Megabytes False
查看磁盤物理插槽信息
#lscfg -vpl hdisk0
hdisk0 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 ent
ent0 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 ent4
adapter_names ent0 EtherChannel Adapters True
auto_recovery yes Enable automatic recovery after failover True
backup_adapter ent2 Adapter used when whole channel fails True
mode standard EtherChannel mode of operation True
netaddr 0 Address to ping True
#lscfg -vpl ent2
ent2 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 en4
netaddr 123.123.123.61 Internet Address True
netmask 255.255.255.128 Subnet Mask True
state up Current Interface Status True
#netstat -in
#netstat -rn
#ifconfig -a
#ifconfig -l
查看網卡當前連接狀態、鏈路速率
#netstat -v en4 |grep -i Speed
Media Speed Selected: Autonegotiate
Media Speed Running: 1000 Mbps / 1 Gbps, Full Duplex
External-Network-Switch (ENS) Port Speed: 1000 Mbps / 1 Gbps, Full Duplex
Media Speed Selected: Auto negotiation
Media 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 fcs
fcs0 Available 01-08 FC Adapter
fcs1 Available 01-09 FC Adapter
fcs2 Available 04-08 FC Adapter
fcs3 Available 04-09 FC Adapter
#lsattr -El fcs0
查看HBA卡的物理插槽、WWN:
#lscfg -vpl fcs0
fcs0 U78A0.001.DNWK9W6-P1-C4-T1 FC Adapter
Network Address.............10000000C9B54A92
Hardware 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 tape
rmt0 Available 02-08-00 SAS 4mm Tape Drive
#lsattr -El rmt0
#lscfg -vpl rmt0
rmt0 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
#lsvg
rootvg
vgora
查看當前active的VG
#lsvg -o
vgora
rootvg
#lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 558 429 111..68..27..111..112
hdisk1 active 558 437 111..76..27..111..112
#lsvg -l rootvg
查看所有PV
#lspv
hdisk0 00cb01e637be5983 rootvg active
hdisk1 00cb01e6dd9045e6 rootvg active
#lspv -l hdisk0
當VG數量未知時,可用以下腳本一次性收集所有VG、LV信息(可結合上文disk信息)
echo "#lsvg "
lsvg
echo "#lsvg -o"
lsvg -o
for i in `lsvg`;
do
echo "nInformation about VG "$i "n#lsvg " $i
lsvg $i
echo "n#lsvg -l " $i
lsvg -l $i
echo "n#lsvg -p " $i
lsvg -p $i
echo "n#lsvg -M " $i
lsvg -M ${i}
done