|
folks,
i have a simple script that is to ssh to a remote host and return the output of uname -a. sounds simple enought...right? the script is taking forever to complete and chews up tons of cpu while trying to accomplish my task. do you guys have any idea what the issue may be?
#!/usr/bin/perl
use strict;
use Net::SSH::Perl;
use Net::SSH::Perl::Auth;
my %params = (
protocol => 2,
interactive => 0,
debug => 1,
);
my $ssh = Net::SSH::Perl->new("10.121.121.5",%params);
$ssh->login("dbc","dbc123");
my($stdout, $stderr, $exit) = $ssh->cmd("uname -a");
print STDOUT "\$stdout = $stdout\n";
print STDOUT "\$stderr = $stderr\n";
print STDOUT "\$exit = $exit\n";
|