This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
rb:findwwnonswitch [03/06/2014 22:53]
rb:findwwnonswitch [16/02/2015 13:03] (current)
Line 1: Line 1:
 ====== Find out which port wwn is connected to ====== ====== Find out which port wwn is connected to ======
 +This script was written to find out the port on a Brocade FC switch which a server port is patched to, knowing the wwn of the server fc port.
 +You will need to add the switch names (not FQDN) into the ''​for SWITCH in''​ part, they will meed to be resolvable in DNS when added to the Domain name. Also, you will need to set the SNMP community string for the switches. It assumes the community string is the same for all switches.
 +Very few assumptions are made on the format of the submitted wwn, so all these formats will work:- ''​0x50014380140f06fa,​ 50:​01:​43:​80:​14:​0f:​06:​fa or 5001-4380-140f-06fa''​.
Line 11: Line 18:
   #1   #1
   SNMPPASS="​public"​   SNMPPASS="​public"​
 +  DOMAIN="​yourdomain.com"​
 +  ​
   OUTFILE=wwnport.txt-$$   OUTFILE=wwnport.txt-$$
Line 67: Line 76:
   do   do
           #echo "​Testing ${SWITCH}"​           #echo "​Testing ${SWITCH}"​
-          snmpwalk -v1 -c ${SNMPPASS} ${SWITCH}.prod.int.com ​mib- | grep -i "​${INPUTWWN}"​ > ${OUTFILE}+          snmpwalk -v1 -c ${SNMPPASS} ${SWITCH}.${DOMAIN} ​mib- | grep -i "​${INPUTWWN}"​ > ${OUTFILE}
   ​   ​
           RESULT1=`echo $?`           RESULT1=`echo $?`

rb/findwwnonswitch.txt ยท Last modified: 16/02/2015 13:03 by andrew