02-03-2009 07:53 AM
"zonehelp" at cmdprompt will give you the commands you need to know for zone scripting.
with "help <command>" you will get the syntax and the description of the command.
I like to build to commands in an external scripting cli (windows shell or linux bash) and then simply paste it into the cli of the switch.
if you build the zonenames on rules for e.g. "<servername>_<hba.nbr.>_<storagesystem>_<storageproc>" it is white easier to do such work.
get a list of zones: zoneshow | grep zone:
copy the output into the notepad or excel, or into a textfile and remove the left field
append zonedelete on each line, paste it into the switch cli, be happy....
02-03-2009 08:01 AM
Thanks Manfred - That doesn't answer the question, but it does provide great knowledge for those who need it.
I will be using expect scripts to do the zoning on Linux. I have installed the expect package on a linux machine, and have tested a modified version of the sample script in wikipedia. Remember to get the prompt correct. For the Brocade 4900, it's "switchname login". I also needed to add a sleep of 10 seconds to telnet into the switch.
02-05-2009 05:31 AM
Commands are ran from the switch's perspective. The command is configupload.
-h Help. Prints this help information.
-p Protocol to use for upload. Valid options are <ftp|scp>
-ftp upload using FTP Protocol. Alternate for "-p ftp"
-scp upload using SCP Protocol. Alternate for "-p scp"
-local upload using local file specified via <filename>
-USB upload local file from an attached USB device.
-U Same as -USB above.
-force Overwrite config file if it exists. Use with -local
Run this command without arguments for interactive mode.
configupload (defaults to interactive mode)
configupload -p ftp | -ftp ]
configupload -p scp | -scp
If <path> is not specified then config filename defaults to config.txt.
Otherwise the specified path is used as is. Examples:
/usr/home/myconfig.txt (config file is /usr/home/myconfig.txt)
(path is default path on FTP server and filename defaults to config.txt)
08-02-2010 01:42 PM
I am with Manfred on this. It is easy to get all the commands prepared in a txt file and then just log on to a switch on the san using putty and just drop the commands in. Using a separate Linux sever seems like adding an extra layer. You can retain the output from the putty session easily enough. I would usually advise just double checking that the commands were accepted before you enter the cfgenable.
Once the zoning is complete we like to capture the entire config by just doing an "alishow" and then saving this as a .txt file - this can often be useful for reference.