Tuesday, January 11, 2011

How to check HBA and get WWPN in RHEL5 or Later

How to check  HBA   and get WWPN  in RHEL5  or Later
Findout what hba adapter is running
# lspci |grep -i -e fib -e hba
You will get output like this.
29:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
29:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
To get wwpn on RHEL (Red Hat) 5.3  or later just run this command:
For a QLogic adapter that is shipped with RHEL 5.x or later, the adapter WWPN information might not be available in the/proc/scsi/adapter_type/n directory because of the migration to sysfs, If this is the case, run the following command:

cat /sys/class/scsi_host/hostn/device/fchost\:hostn/port_name

where n is the host adapter number for your card.
For Example:
[root@baskar.com proc]# cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_
port_id     port_name   port_state  port_type
[root@baskar.com proc]# cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_id
0x4d8207
[root@baskar.com proc]# cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_name
0x21000024ff200966
[root@baskar.com proc]# cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_state
Online
[root@baskar.com proc]# cat /sys/class/scsi_host/host0/device/fc_host\:host0/port_type
NPort (fabric via point-to-point)

No comments:

Post a Comment