Smith has asked for the wisdom of the Perl Monks concerning the following question:
$rtrs = "$workdir/bin/wanrtrs"; $outfile = "$workdir/$date-allnetrtrscn.raw"; open ($INR,$rtrs) || die "Can't open the file: $!\n"; open ($OUT,">>$outfile") || die "Can't open the file: $!\n"; while (<$INR>){ chomp(); push(@rtrs, $_); } foreach $host (@rtrs){ $remote = Net::SSH::Perl->new($host); $remote->login($user, $pass); if ( ! $remote ){ print "ERROR: Problem Connecting to $host\n"; $remote = Net::Telnet->new($host); $remote->login($user, $pass); } ($stdout) = $remote->cmd("sh ip vrf int"); print $OUT "$host:sh ip vrf int\n$stdout\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I stop SSH Module from dieing?
by Fletch (Bishop) on Jan 29, 2007 at 16:09 UTC | |
|
Re: How do I stop SSH Module from dieing?
by educated_foo (Vicar) on Jan 29, 2007 at 16:15 UTC | |
|
Re: How do I stop SSH Module from dieing?
by RobPayne (Chaplain) on Jan 29, 2007 at 16:40 UTC | |
by Smith (Initiate) on Jan 29, 2007 at 20:19 UTC |