To find the WWPN and Other information of Qlogic HBAs without restarting the host, you can use any of the following methods.
for i in `seq 0 4` ;
do echo #####Host $i ######;
cat /sys/class/fc_host/host$i/port_name;
cat /sys/class/fc_host/host$i/port_state;
cat /sys/class/fc_host/host$i/port_type;
cat /sys/class/fc_host/host$i/speed;
cat /sys/class/fc_host/host$i/supported_speeds;
done
Your output may be the following,
0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit0x2101001b32xxxxx
Online
NPort (fabric via point-to-point)4 Gbit
1 Gbit, 2 Gbit, 4 Gbit0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)unknown4 Gbit
1 Gbit, 2 Gbit, 4 Gbit0x2101001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit0x2100001b32xxxxx
Online
NPort (fabric via point-to-point)
4 Gbit
1 Gbit, 2 Gbit, 4 Gbit
You can also use systool to find Port_name
$ systool -av -c fc_host
Class = “fc_host”Class Device = “host0″
Class Device path = “/sys/class/fc_host/host0″
fabric_name = “0x2000001b32xxxxx”
issue_lip = <store method only>
node_name = “0x2000001b32xxxxx”
port_id = “0×000000″
port_name = “0x2100001b32xxxxx”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “4 Gbit”
supported_classes = “Class 3″
supported_speeds = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent = <store method only>Device = “host0″
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:01.0/0000:25:00.0/host0″
optrom_ctl = <store method only>
uevent = <store method only>Class Device = “host1″
Class Device path = “/sys/class/fc_host/host1″
fabric_name = “0x2001001b32xxxxx”
issue_lip = <store method only>
node_name = “0x2001001b32xxxxx”
port_id = “0×000000″
port_name = “0x2101001b32xxxxx”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “4 Gbit”
supported_classes = “Class 3″
supported_speeds = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent = <store method only>Device = “host1″
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:01.0/0000:25:00.1/host1″
optrom_ctl = <store method only>
uevent = <store method only>Class Device = “host2″
Class Device path = “/sys/class/fc_host/host2″
fabric_name = “0x2000001b32xxxxx”
issue_lip = <store method only>
node_name = “0x2000001b32xxxxx”
port_id = “0×000000″
port_name = “0x2100001b32xxxxx”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “4 Gbit”
supported_classes = “Class 3″
supported_speeds = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent = <store method only>Device = “host2″
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:02.0/0000:22:00.0/host2″
optrom_ctl = <store method only>
uevent = <store method only>Class Device = “host3″
Class Device path = “/sys/class/fc_host/host3″
fabric_name = “0x2001001b32xxxxx”
issue_lip = <store method only>
node_name = “0x2001001b32xxxxx”
port_id = “0×000000″
port_name = “0x2101001b32xxxxx”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “4 Gbit”
supported_classes = “Class 3″
supported_speeds = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent = <store method only>Device = “host3″
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:02.0/0000:22:00.1/host3″
optrom_ctl = <store method only>
uevent = <store method only>Class Device = “host4″
Class Device path = “/sys/class/fc_host/host4″
fabric_name = “0x2000001b32xxxxx”
issue_lip = <store method only>
node_name = “0x2000001b32xxxxxx”
port_id = “0x65b913″
port_name = “0x2100001b32xxxxxx”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “4 Gbit”
supported_classes = “Class 3″
supported_speeds = “1 Gbit, 2 Gbit, 4 Gbit”
tgtid_bind_type = “wwpn (World Wide Port Name)”
uevent = <store method only>Device = “host4″
Device path = “/sys/devices/pci0000:00/0000:00:04.0/0000:17:00.0/0000:18:09.0/0000:1c:00.0/host4″
optrom_ctl = <store method only>
uevent = <store method only>
There are also other ways to find the WWPNs of HBAs, Please follow the link
http://linuxshellaccount.blogspot.com/2008/09/how-to-easily-find-wwns-of-qlogic-hba.html


