aqwsh2006 has asked for the wisdom of the Perl Monks concerning the following question:
I set timeout=1 in $ssh->capture2,but this don't return after 1 seconds, and this error message is "ssh slave failed: timed out"
#!/usr/bin/perl use strict; use Net::OpenSSH; my $host='192.0.0.11'; my $user='oracle'; my %param=( user => $user, password=>'xxxxxx', timeout => 10, port => '22' ); my $ssh = Net::OpenSSH->new($host,%param); my ($stdout,$stderr) = $ssh->capture2({timeout => 1},"echo hello; slee +p 10; echo bye"); if($stderr){ print $stderr; } $ssh->error and warn "operation didn't complete successfully: ". $ssh->error;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: why timeout not working in Net::OpenSSH
by Loops (Curate) on Aug 07, 2013 at 06:32 UTC | |
by aqwsh2006 (Initiate) on Aug 07, 2013 at 09:45 UTC |
Back to
Seekers of Perl Wisdom