I needed to be able to find the WWPN on our HBAs, along with find out which port on the remote device it was attached to. I found the following commands out there somewhere.
Make sure sysfsutils are installed (on redhat machines).
systool -c fc_host -v
This will list all fiber channel ports on the system, with their device names, port names, and other miscellaneous information. port_name is what you want for the wwpn. You can match that with the device information to find out specifically which port it is.
Then use the other command:
systool -c fc_transport -v
and look for the same device name (host10, host4, etc), and the port_name there is the port on the other side that port is connected to.