Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::Appliance::Session issue, or something else?

Status
Not open for further replies.

scottdware

Technical User
Apr 15, 2003
30
US
Hello,

I am having trouble on some of my SSH scripts that are using the
Net::Appliance::Session module on a Unix (Solaris 9) box.

Basically, I keep getting the error:

"Login failed to remote host at line..."
"Pattern match time-out"

Can you see any reason as to why I am getting that? If I use this on
Cygwin, it works fine, but I don't know why it wouldn't work on Unix?

Here's a test script:

#!/usr/local/bin/perl

use strict;
use warnings;
use Net::Appliance::Session;

my $user = "username";
my $pass = "password";
my $host = "somehost.domain.com";
my $command = "show ip int brie";

my $ssh = Net::Appliance::Session->new(Host => $host, Transport =>
'SSH');

eval {
$ssh->connect(Name => $user, Password => $pass, SHKC => 0);
$ssh->cmd(String => $command, Timeout => 30);
sleep 2;

};

if (UNIVERSAL::isa($@, 'Net::Appliance::Session::Exception')) {
print $@->message ."\n";
print $@->lastline ."\n";
print $@->errmsg ."\n";
}
 
Ok, I figured it out. I had to place the "App" option within the connect construct, and then it worked as intended:

$ssh->connect(Name => $user, Password => $pass, SHKC => 0, App => '/usr/local/bin/ssh');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top