in reply to Re^6: Problem with Net::SSH::Expect on unavailable hosts
in thread Problem with Net::SSH::Expect on unavailable hosts

Ok, this is straight out of a script I use frequently to setup a ssh tunnel. Replace $ssh->login() with your call to $ssh->run_ssh() or modify your script to use id/pwd auth. I haven't been able to recreate the script bombing out, so I'm not sure whether this will fix your problem or not -- speaking of which, have you made sure that you're at the current level for Net::SSH::Expect?
#sometimes the connection isn't ready to login yet, so we try up to +max_retry_count times before giving up my $retry_count = 0; while(1){ $rc = eval{$ssh->login();}; last if defined $rc; last if $retry_count >= $max_retry_count; $retry_count++; sleep 1; }
Now that I've looked at Expect.pm a little more closely, I can see that I'm not using $ssh->login() correctly...but it does seem to work. So give it a shot and I'll look for a better way of doing the retry loop.