rageek

A place for Unix Thoughts and Ideas

Printing out HBA and WWN information on HP-UX

Here is a quick way of printing out information on all the Fibre adapters in a HP-UX system

This one liner prints out the WWN of the HBA ports and the state

root@testserver # for i in `ioscan -fknC fc | grep ‘/dev/’`; do echo $i; fcmsutil $i;done | egrep ‘World|Hardware|/dev|Driver state’
/dev/fcd0
N_Port Node World Wide Name = 0x50014380033a1709
N_Port Port World Wide Name = 0x50014380033a1708
Switch Port World Wide Name = 0x2096000dec2e2ac0
Switch Node World Wide Name = 0x2016000dec22a641
Driver state = ONLINE
Hardware Path is = 0/3/1/0/4/0
/dev/fcd1
N_Port Node World Wide Name = 0x50014380033a170b
N_Port Port World Wide Name = 0x50014380033a170a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/3/1/0/4/1
/dev/fcd2
N_Port Node World Wide Name = 0x50014380033a1719
N_Port Port World Wide Name = 0x50014380033a1718
Switch Port World Wide Name = 0x2098000dec350940
Switch Node World Wide Name = 0x2015000dec217c81
Driver state = ONLINE
Hardware Path is = 0/7/1/0/4/0
/dev/fcd3
N_Port Node World Wide Name = 0x50014380033a171b
N_Port Port World Wide Name = 0x50014380033a171a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/7/1/0/4/1
Hardware Path is = 0/4/1/0

The following one liner will print out the same the WWN info of the HBA ports and adds any targets that it sees

root@testserver # for i in `ioscan -kfnC fc | grep ‘/dev/’`; do printf “\n${i}\n”; fcmsutil $i | egrep ‘World|Hardware|/dev|Driver state’; echo “Targets Found”; fcmsu
til $i get remote all | egrep ‘N_Port_id|Port World’ || printf “\t\tNone Found\n”;done

/dev/fcd0
N_Port Node World Wide Name = 0x50014380033a1709
N_Port Port World Wide Name = 0x50014380033a1708
Switch Port World Wide Name = 0x2096000dec2e2ac0
Switch Node World Wide Name = 0x2016000dec22a641
Driver state = ONLINE
Hardware Path is = 0/3/1/0/4/0
Targets Found
Target N_Port_id is = 0x170026
Target Port World Wide Name = 0x50060e8005486b7a

/dev/fcd1
N_Port Node World Wide Name = 0x50014380033a170b
N_Port Port World Wide Name = 0x50014380033a170a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/3/1/0/4/1
Targets Found
None Found

/dev/fcd2
N_Port Node World Wide Name = 0x50014380033a1719
N_Port Port World Wide Name = 0x50014380033a1718
Switch Port World Wide Name = 0x2098000dec350940
Switch Node World Wide Name = 0x2015000dec217c81
Driver state = ONLINE
Hardware Path is = 0/7/1/0/4/0
Targets Found
Target N_Port_id is = 0x190026
Target Port World Wide Name = 0x50060e8005486b6a

/dev/fcd3
N_Port Node World Wide Name = 0x50014380033a171b
N_Port Port World Wide Name = 0x50014380033a171a
Switch Port World Wide Name = 0x0000000000000000
Switch Node World Wide Name = 0x0000000000000000
Driver state = AWAITING_LINK_UP
Hardware Path is = 0/7/1/0/4/1
Targets Found
None Found

And you can get the model information with a ioscan

root@testserver # ioscan -kfnC fc
Class I H/W Path Driver S/W State H/W Type Description
========================================================================
fc 0 0/3/1/0/4/0 fcd CLAIMED INTERFACE HP AD194-60001 PCI/PCI-X Fibre Channel 2-port 4Gb FC/2-port 1000B-T Combo Adapter (FC Port 1)
/dev/fcd0
fc 1 0/3/1/0/4/1 fcd CLAIMED INTERFACE HP AD194-60001 PCI/PCI-X Fibre Channel 2-port 4Gb FC/2-port 1000B-T Combo Adapter (FC Port 2)
/dev/fcd1
fc 2 0/7/1/0/4/0 fcd CLAIMED INTERFACE HP AD194-60001 PCI/PCI-X Fibre Channel 2-port 4Gb FC/2-port 1000B-T Combo Adapter (FC Port 1)
/dev/fcd2
fc 3 0/7/1/0/4/1 fcd CLAIMED INTERFACE HP AD194-60001 PCI/PCI-X Fibre Channel 2-port 4Gb FC/2-port 1000B-T Combo Adapter (FC Port 2)
/dev/fcd3

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: