Creating al list of port WWPnnumbers for physical adapters.

Pre-work:

the adapters or of type:8 Gigabit PCI Express Dual Port Fibre Channel Adapter  and lsdev -PH gives me this:

lsdev -PH
class          type            subclass       description

adapter        df1000f114108a0 pciex          8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)

 

So on a host I can do this:

#lsdev -Ctdf1000f114108a0
fcs0 Available 01-00 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs1 Available 01-01 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs2 Available 05-00 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs3 Available 05-01 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)

 

Now the little script to summarise it ,together with WWPN numbers and also having the WWPn numbers split into HH;HH;HH;HH  :

 

hostn=`hostname`
for fc in ` lsdev -Ctdf1000f114108a0 | grep Available | awk '{ print $1}'`
do
 pwwpn=`lscfg -vpl $fc | grep Network |awk -F"." '{print $NF}'`
 pwwpn_column=`echo $pwwpn|sed 's/../&:/g;s/:$//'`
 echo $hostn";"$fc";"$pwwpn";"$pwwpn_column
done

 

Outcome looks like:

  be001;fcs0;10000000C1FF3846;10:00:00:00:C1:FF:38:46
  be001;fcs1;10000000C1FF3847;10:00:00:00:C1:FF:38:47
  be001;fcs2;10000000C19A7E4A;10:00:00:00:C1:9A:7E:4A
  be001;fcs3;10000000C19A7E4B;10:00:00:00:C1:9A:7E:4B

Comments are closed.

Previous Post
«
Next Post
»