Any suggestions?
Yes, is there any possibility you can run the script from a Linux box? Because doing this kind of sys admin tasks from Windows is an agony.
Well, in any case, post your script source code.
Can you install software on the Linux gateway or just allowed to run ssh in order to connect to the remote cisco?
| [reply] [d/l] |
I work remotely, have to VPN into a network, SSH to the jumpbox(gateway, then ssh to actual cisco devices, only basic user access on the linux box
Every week we have to capture bunch information from various sites' network devices, it is a manual intensive work which suits perlscript perfectly
$chan->shell();
print $chan "ssh -l username 10.1.1.1\n";
while($buf=<$chan>){
if($buf =~ /"password:"/)
{ print $chan "password\n"; # got password prompt}
else { exit; # export debug info, not reachable etc }
}
#
# Once SSH into cisco switches, process cisco commands here
# The actually commands are input from a separate file,
# this is just an example.
#
print $chan "show tech\n";
print $chan "show version\n";
| [reply] [d/l] |
Try requesting allocation of a pty:
$chan->pty(1);
$chan->shell();
...
| [reply] [d/l] |