in reply to Re^5: run a perl script on a unix machine from a win machine
in thread run a perl script on a unix machine from a win machine
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: run a perl script on a unix machine from a win machine
by salva (Canon) on Jan 28, 2012 at 14:53 UTC | |
by Anonymous Monk on Jan 28, 2012 at 18:40 UTC |