Thanks for your help chaps, appreciate it.
I haven't figured out yet how OnTAP works to get switch names .. probably it queries FCNS service somehow. I've tried HBA CLI utilities from both Qlogic and Emulex, none of it exposes what I want, basically they do the same parsing of /sys/* as "systool" does.
My findings so far and I can already make use of it (might be well just Brocade based fabric specific):
// all in HEX below
# cat /sys/class/fc_host/host1/port_id 0x680400
0x68 - Switch ID, must be unique in a fabric 0x04 - port number on the "0x68" switch
# cat /sys/class/fc_host/host1/fabric_name 0x1000000533d316ea
As John pointed out, it's the switch's WWN, again must be unique
So having both "port_id" and "fabric_name" + some sort of SAN inventory, like "switch_name -- WWN", one can identify storage attached server position on SAN fabric. I'd say if you have <= 10 switches to manage, it's doable .. not sure if it's going to work when managing hundreds of switches.
Here is also a document I found, might be useful to take a look - https://community.emc.com/servlet/JiveServlet/previewBody/12212-102-1-46887/...
Cheers, Vladimir
On Wed, Apr 23, 2014 at 12:30 PM, Borzenkov, Andrey andrey.borzenkov@ts.fujitsu.com wrote:
And to get port HBA is connected to:
~ # cat /sys/class/fc_host/host3/port_id 0x010800
Although it still needs knowledge of exact switch model, in general you cannot map it 1-to-1 to physical port numbers. But it provides useful cross-reference with information from switches :)
-----Original Message----- From: toasters-bounces@teaparty.net [mailto:toasters-bounces@teaparty.net] On Behalf Of John Constable Sent: Wednesday, April 23, 2014 1:23 PM To: Momonth Cc: toasters@teaparty.net Subject: Re: FCP switch / port info
jc18@storage-test3:~$ cat /sys/class/fc_host/host0/fabric_name 0x100000051e56bf0a