LINUX: Finding Fiber HBA WWN
The info is in
/sys/class/scsi_host/hostN/device/fc_host/hostN/port_name
Where “N” is the number of device for your fiber HBAs.
Unfortunately, you may have a large number of listings depending on the different cards (besides fiber HBA) that you have on your system. In my example, I have six listings:
host0
host1
host2
host3
host4
host5
but only two represent a fiber HBA.
So you may have to do some digging. In my case they are
host4
host5
(I have two HBAs installed)
So …
[root@centos63node01 ~]# cat /sys/class/scsi_host/host4/device/fc_host/host4/port_name
0x5001438003af1ffc
[root@centos63node01 ~]# cat /sys/class/scsi_host/host5/device/fc_host/host5/port_name
0x5001438003af1b9e
[root@centos63node01 ~]#
Here’s my shortcut bash command if you don’t want to look around. This command is executed in the/sys/class/scsi_host directory.
[root@centos63node01 scsi_host]# for i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done
cat: host0/device/fc_host/host0/port_name: No such file or directory
cat: host1/device/fc_host/host1/port_name: No such file or directory
cat: host2/device/fc_host/host2/port_name: No such file or directory
cat: host3/device/fc_host/host3/port_name: No such file or directory
0x5001438003af1ffc
0x5001438003af1b9e
[root@centos63node01 scsi_host]#
No comments:
Post a Comment