rageek

A place for Unix Thoughts and Ideas

Printing out WWN and HBA information on Solaris 10

Sometime in the last couple months the Emulex utilities for the Leadville drivers stopped working on Solaris 10 and I lost my old method of collecting WWNs on the server.

You could get the info by running fcinfo, but I hate having to hunt for my desired information
root@testserver-01 # fcinfo hba-port
HBA Port WWN: 10000000c97b252c
OS Device Name: /dev/cfg/c2
Manufacturer: Emulex
Model: LPe11000-M4
Firmware Version: 2.72a2 (Z3D2.72A2)
FCode/BIOS Version: Boot:5.03a0 Fcode:3.01a1
Serial Number: VM82387425
Driver Name: emlxs
Driver Version: 2.50o (2010.01.08.09.45)
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 20000000c97b252c
HBA Port WWN: 10000000c97b2351
OS Device Name: /dev/cfg/c3
Manufacturer: Emulex
Model: LPe11000-M4
Firmware Version: 2.72a2 (Z3D2.72A2)
FCode/BIOS Version: Boot:5.03a0 Fcode:3.01a1
Serial Number: VM82387252
Driver Name: emlxs
Driver Version: 2.50o (2010.01.08.09.45)
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 20000000c97b2351

Here is a quick way of getting the information and additionally map the WWN to the device path and controller number which is handy double checking your controllers prior to disabling paths

for i in ` fcinfo hba-port -l | grep “Port WWN” | cut -d: -f2`; do
CTR=`fcinfo hba-port -l |egrep ‘Port WWN|Model|Device’ | awk “/${i}/{getline; print}” | grep OS | cut -d/ -f4`
DEVP=`cfgadm -v $CTR | grep fc | awk ‘{print $4}’ | sed -e ‘s,/fp.*,,’`
MDL=`fcinfo hba-port -l | egrep ‘Port WWN|Model|Device’ | awk “/${i}/{print; getline; print; getline; print}” | cut -d: -f2 | perl -pe ‘s/\n//’ | awk ‘{print $3 ” ” $1 }’`
printf “${MDL} ${CTR} ${DEVP}\n”
done

This gives a nice formatted output of:

LPe11000-M4 10000000c97b252c c2 /devices/pci@0/pci@0/pci@8/pci@0/pci@1/lpfc@0
LPe11000-M4 10000000c97b2351 c3 /devices/pci@0/pci@0/pci@8/pci@0/pci@9/lpfc@0

Alternatively, you get similar information from DMP using

root@testserver-01 # vxdmpadm getctlr
LNAME PNAME VENDOR CTLR-ID
========================================================================================================
c2 /pci@0/pci@0/pci@8/pci@0/pci@1/lpfc@0/fp@0,0 Emulex 10:00:00:00:c9:7b:25:2c
c3 /pci@0/pci@0/pci@8/pci@0/pci@9/lpfc@0/fp@0,0 Emulex 10:00:00:00:c9:7b:23:51

One of my Colleagues has suggested that in a pinch, you can always run

root@testserver-01 # prtconf -vp|grep port_wwn
port_wwn: 10000000.c97b252c
port_wwn: 10000000.c97b2351

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: