Fibre Channel (SAN)

Reply
Occasional Contributor
Posts: 16
Registered: ‎02-25-2011

telnet and scripts

I'm using telnet/ssh for switch administration. Sometimes I have to issue repetitive commands with loooong list of arguments. That's boring and error-prone. Can I use scripts for that purpose?

I mean scenarion similar to the following:

1. I create text file on my PC

2. Then upload the file to the switch

3. Then run the script from a file.

Is it possible?

--

R.Skorupka

External Moderator
Posts: 5,046
Registered: ‎02-23-2004

Re: telnet and scripts

Andreas Bergelt is the Script EXPERT here in the Community.

I not know another one.

TechHelp24
Super Contributor
Posts: 635
Registered: ‎04-12-2010

Re: telnet and scripts

Thanks TechHelp24 for the flower as we say in Germany...

Perl gives you a huge bunch of packages to automate this kind of jobs.

I use the Net::SSH:Perl package and some self made function to format the returning output.

A simple way is to use a Linux or a Unix box for this tasks. It is very difficult to get a Perl SSH session running on a Windows box.

Cygwin is one way for Windows.

Running an automated SSH session is a bit  different  compared what you are asking for.

There is no need for uploading files into the switch FS and pushing the results back to an FTP server.

You need a function which creates a ssh object with an IP address, Username Password and one or more commands.

The function will return the command output.  In addition you need some error reporting as well.

I hope this helps,

Andreas

Join the Community

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

vADC is now Pulse Secure
Download FREE NVMe eBook