Fibre Channel (SAN)

Reply
Contributor
Posts: 22
Registered: ‎02-24-2014

Send zoning commands via noninteractive SSH

Hi,

 

I am planning an installation that will add thousands of zones to a director, and I want to see if anyone has a better way of doing this than my current plan. Thousands of CLI commands are generated by the a script that also does the masking on the storage. Unlike my storage, however, Brocade directors have sessions- you have to log into the switch and enter the commands interactively. If you get disconnected, you lose all the work, unless you've run a cfgsave. If you're entering them by copy-pasting from the buildfile, if you put too many in your buffer (at least in putty), sometimes commands get corrupted or lost.

 

On every other machine in my environment, I can issue noninteractive commands (like "create a lun of this size on this pool", or "allocate this LUN to that hostgroup on this port") one at a time with ssh. Is there a way to do this for zoning commands in FOS 7.x? I think every time the ssh command completes all the lines I've fed it and returns me to my server's shell, the switch discards all the work that was done unless I've done a cfgsave. And cfgsave asks for operator interaction, so can't be sent along with the alicreates, zonecreates, and cfgadds.

 

Thanks!

Valued Contributor
Posts: 547
Registered: ‎03-20-2011

Re: Send zoning commands via noninteractive SSH

hi! i used to do this with "expect" utility.
Frequent Contributor
Posts: 107
Registered: ‎04-05-2011

Re: Send zoning commands via noninteractive SSH

Hy!

 

What tools do you have ?

 

If you Have Brocade network advisor, you may tweak a configuration file ang generate one with your zones and import it to the fabric.

 

If you have a linux box, you may use a python script with ssh module and do the work, or if do not want to use python, you may simply use expect, but i prefer the python approach, because you can add more "intelligence" to the solution.

 

another solution, but less elegant is to use a software called autohotkey (for windows) and perform macro operations to cut and paste each zone at a time from a text file, or excel spreadsheet.

 

as you can see, there are many ways to do that, just choose one that fits your needs and efforts.

Contributor
Posts: 22
Registered: ‎02-24-2014

Re: Send zoning commands via noninteractive SSH

[ Edited ]

I'm using AIX, and perl instead of python. That said, the script you seem to be describing would be something that would do all the commands in an interactive shell? I could probably write that.

 

That said, zoning shouldn't require an interactive session. 

Frequent Contributor
Posts: 107
Registered: ‎04-05-2011

Re: Send zoning commands via noninteractive SSH


Canadian_Storage_Guy wrote:

I'm using AIX, and perl instead of python. That said, the script you seem to be describing would be something that would do all the commands in an interactive shell? I could probably write that.

 

That said, zoning shouldn't require an interactive session. 


Hi Canadian Storage Guy!

 

So you have the best tools in your hand!

 

You are right, just keep in mind that you must have an interective session opened, because if not, you will get that weird "thats not a typewriter" message from the server.

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.