This post is more than 5 years old
59 Posts
0
15921
March 5th, 2007 09:00
Quick way to find port on switch for alias
Hello all,
I am looking for a quick way via cli to get an alias for a WWN or port and vis virsa. Here is what I have so far.
With the latest 5.2.x firmware code you can now grep output of commands (Thank you Brocade!!! It's about time!!) Here are some scenarios I am dealing with.
1. I know what port my host is on, so:
portshow x/y (gather WWN xx:yy:zz)
alishow | grep -B 2 xx:yy:zz
Yeah I now know what my alias is for that port.
2. I know what the alias is but I need to know what port it is on:
alishow | grep -A 3 12345
which will return:
alias: HBA0_12345
21:00:00:00:00:xx:yy:zz
Then I can use the WWN to find it in the nameserver table with
nsshow (or nscamshow) | grep xx:yy:zz
Which returns:
N 023300; 3;21:00:00:00:00:xx:yy:zz;20:00:00:00:00:xx:yy:zz; na
So the question is:
Is there a command or calculation (on the switch) to quickly convert the HEX value to the port? I know, I know I can calculate it in my head or a calculator, however that is not the reason for the script I am creating.
Let me know if you guys have any ideas.
Shmac
I am looking for a quick way via cli to get an alias for a WWN or port and vis virsa. Here is what I have so far.
With the latest 5.2.x firmware code you can now grep output of commands (Thank you Brocade!!! It's about time!!) Here are some scenarios I am dealing with.
1. I know what port my host is on, so:
portshow x/y (gather WWN xx:yy:zz)
alishow | grep -B 2 xx:yy:zz
Yeah I now know what my alias is for that port.
2. I know what the alias is but I need to know what port it is on:
alishow | grep -A 3 12345
which will return:
alias: HBA0_12345
21:00:00:00:00:xx:yy:zz
Then I can use the WWN to find it in the nameserver table with
nsshow (or nscamshow) | grep xx:yy:zz
Which returns:
N 023300; 3;21:00:00:00:00:xx:yy:zz;20:00:00:00:00:xx:yy:zz; na
So the question is:
Is there a command or calculation (on the switch) to quickly convert the HEX value to the port? I know, I know I can calculate it in my head or a calculator, however that is not the reason for the script I am creating.
Let me know if you guys have any ideas.
Shmac
No Events found!


mpi2
2 Intern
•
215 Posts
0
August 20th, 2007 12:00
If you have a login you can download a perl script called: switchshow_nsaliases.pl
Description: Displays an extended output like switchshow with name aliases and WWNNs for fabric wide or a single switch depending on choice.
I hadn't the possibilty to test the script until now.
You need perl 5.8.x and the NET::Telnet Module.
Maybe this script helps you.
best regards
Manfred
mpi2
2 Intern
•
215 Posts
0
July 30th, 2007 01:00
Do you know the tool "SAN Health" from Brocade?
It is a freeware tool to generate a Report from your SAN. (you'll find it on the brocade website very quickly)
There you get a list of wwnns + aliases and much more.
regards
Manfred
Navin-Swn_9
66 Posts
0
August 16th, 2007 07:00
I was suppose to create and maintain a excel file with "3 columns".
1. Port number of the switch
2. Alias..
3. WWN..
and have 30 switches in my shop divided in 2 fabrics.(for redundancy).. SAN health is a beautiful tool but i prefer the manual way.
I dumped the supportshow of one of the switch and opened it in winword. I scrolled thru the file till i came to the alias section. Copied all the alias along with the wwn which were shown below one another and pasted in excel.
Now i created a macro in excel which puts the alias next to the WWN row in my "3 column" switch detail sheet.
It took me 1 day to create the file and macro (as i am not good in excel macros
But i can update the file by just dumping the alias section of supportshow in my excel and the macro takes care of publishing the file..
Me and my team are happy with what i've been able to do..
Thanks,
Navin.