sub _startMonitorThread { $self = shift; $self->{LogQ} = Thread::Queue->new; my $id = "LogMonitor"; my $thrd = new threads \&_LogMonitor, $id; if ( !$thrd ) { $self->{errormsg} = "$thisFunc:Cannot start $id thread"; $self->TestLogError(); return -1; } $self->{thrds}->{logmon} = $thrd; $self->{logqueue} = 1; return 0; } #### sub getsshrsa { my $thisFunc = ( caller(0) )[3]; my $opts = shift; my $ip = $opts->{ip}; $opts->{timeout} = 5 if (!$opts->{timeout}); my $ssh = Net::SSH::Expect->new ( host => $ip, user => $opts->{user}, password => $opts->{password}, ssh_option => "-T", raw_pty => 1 ); my $error = undef; $ssh->run_ssh() or $error = "SSH process couldn't start: $!"; return $error if ($error); $ssh->send(" "); sleep 2; my $output = $ssh->read_all(5); # <-- fails here return $ssh; } #### Killed by signal 1. SSHConnectionAborted at MGComm.pm line 87 at /opt/ActivePerl-5.14/site/lib/Net/SSH/Expect.pm line 585 Net::SSH::Expect::_sec_expect('Net::SSH::Expect=HASH(0x34f9890)', 5, '-re', 'Regexp=REGEXP(0x351a2c0)') called at /opt/ActivePerl-5.14/site/lib/Net/SSH/Expect.pm line 419 Net::SSH::Expect::read_all('Net::SSH::Expect=HASH(0x34f9890)', 5) called at MGComm.pm line 87 MGComm::getsshrsa('HASH(0x35235e0)') called at MGcld.pm line 87