您的位置:首页 > 运维架构 > Shell

IBM AIX系统硬件信息查看命令(shell脚本)

2012-01-09 08:41 1281 查看
转自:http://xunzhaoxz.itpub.net/post/40016/522464



一、查看型号、序列号、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信息等。

echo "#lsdev -Cc disk"

lsdev -Cc disk

for i in `lsdev -Cc disk|awk '{print $1}'`;

do

echo "nInformation about "$i "n#bootinfo -s" $i

bootinfo -s $i

echo "n#lsattr -El" $i

lsattr -El $i

echo "n#lscfg -vpl " $i

lscfg -vpl $i

echo "n#lspv " $i

lspv $i

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
在网卡数量未知的情况下,可以采用以下脚本一次性收集所有网卡信息:

echo "#lsdev -Cc adapter|grep ent"

lsdev -Cc adapter|grep ent

for i in `lsdev -Cc adapter|awk '{print $1}' |grep ent`;

do

echo "nInformation about "$i "n#lsattr -El" $i

lsattr -El $i

echo "n#lscfg -vl " $i

lscfg -vl $i

done

for i in `ifconfig -l`;

do

echo "nInformation about "$i "n#lsattr -El" $i

lsattr -El $i

echo "n#netstat -v " $i

netstat -v $i

echo "n#netstat -v " $i "|grep -i Speed"

netstat -v $i |grep -i Speed

done

复制代码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息