SuperSu has asked for the wisdom of the Perl Monks concerning the following question:
Here is the requirement:
I need to write a perl script to have the follow function:
Input: IP,Username,Password,command,protocal
Process: Login the switch (according to the IP) via SSH1 or SSH2 (according to the Protocal), then execute the given command
Output: The result from the switch.
Example:
Input:1.1.1.1,cisco,cisco,show version,SSH1
The script should be able to run in the following enviroment:
1. Redhat+Perl
2. WinXP+ActivePerl
So I tried the following:
1. Net::SSH::Perl - Too many dependency, can not insatll successfully and the same with Net::SSH::W32Perl.(Because of the net connection limit I must install mannuly)
2.Net::SSH::Expect for SSH1, Net::SSH2 for SSH2, this works good under linux but the Net::SSH::Expect can not be insatll under windows because of the dependency of IO::PTY (works in Cygwin though .....Why.....)
3.OpenSSH, I think this may work but I'll have to write some codes myself instead of using the package, but now I've even no idea how to write code to login the switch using SSH command (Although I know how to loging the switch by typing the command in the shell or cmd via interactive mode)
Any suggestion or advice would be great, thanks^_^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Looking for suggestion...
by NetWallah (Canon) on Jul 15, 2010 at 04:38 UTC | |
|
Re: Looking for suggestion...
by intel (Beadle) on Jul 15, 2010 at 02:58 UTC | |
|
Re: Looking for suggestion...
by ww (Archbishop) on Jul 15, 2010 at 01:28 UTC | |
|
Re: Looking for suggestion...
by aquarium (Curate) on Jul 15, 2010 at 04:31 UTC |