Re: Net::Appliance::Session error? or something else?
- From: scottdware <scottdware@xxxxxxxxx>
- Date: Thu, 5 Mar 2009 10:04:37 -0800 (PST)
On Mar 5, 12:43 pm, scottdware <scottdw...@xxxxxxxxx> wrote:
On Mar 5, 11:35 am, smallpond <smallp...@xxxxxxxx> wrote:
On Mar 5, 10:36 am, scottdware <scottdw...@xxxxxxxxx> wrote:
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";
}
The login prompt is not matching what the module expects.
Read the "Important Notes ..." section of Net::SSH::Expect
documentation.
Thanks. But why would the Net::SSH::Expect module come in handy here,
since I'm not using it? Does it pull from that as well?
Ok, I figured it out. I had to specify the "App" parameter inside of
the connect constructor, and then it worked as intended:
$ssh->connect(Name => $user, Password => $pass, SHKC => 0, App => '/
usr/local/bin/ssh');
.
- References:
- Net::Appliance::Session error? or something else?
- From: scottdware
- Re: Net::Appliance::Session error? or something else?
- From: smallpond
- Re: Net::Appliance::Session error? or something else?
- From: scottdware
- Net::Appliance::Session error? or something else?
- Prev by Date: A globbing question
- Next by Date: Re: A globbing question
- Previous by thread: Re: Net::Appliance::Session error? or something else?
- Next by thread: use constant and hash
- Index(es):
Relevant Pages
|