Re: Net::Appliance::Session error? or something else?



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');
.



Relevant Pages

  • Re: What is the more popular UNIX flavor?
    ... about my experience with Solaris and Cygwin. ... installing packages. ... needing eg tftp you only need to activate on a Unix system. ... probably need installing first on the equivalent Windows system. ...
    (comp.unix.questions)
  • Re: TeX and friends
    ... There is a core of a Unix OS in the foundations, ... which does of course mean that it's easy to write a nice integrated GUI ... but what about when you can't write any documentation at all ... the source code is ...
    (uk.people.support.depression)
  • Re: The Problems of TeX
    ... I had never done any non-trivial configuration of TeX distributions ... But you do fall into the category of `Unix expert', ... because you have learnt how to use the documentation. ... neophytes have succeeded in installing and then productively using ...
    (comp.text.tex)
  • Re: Where to ask Unix command line questions?
    ... match on a non-printing character. ... on MacOS X 10.4.11, but I don't think I'll be able to work it out ... Not a lot of use if you're after documentation, ... Oh yes it is - it's just that the people who live in the Unix world want ...
    (uk.comp.sys.mac)
  • Re: The Problems of TeX
    ... I had never done any non-trivial configuration of TeX distributions ... But you do fall into the category of `Unix expert', ... because you have learnt how to use the documentation. ...
    (comp.text.tex)