Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Using Net::OpenSSH

by dorel (Initiate)
on Oct 05, 2017 at 20:16 UTC ( #1200769=perlquestion: print w/replies, xml ) Need Help??
dorel has asked for the wisdom of the Perl Monks concerning the following question:

Hi there, Im trying to connect to ZyXEL VMG8324-B10A via ssh using perl script with module Net::OpenSSH. I'm using straight from ducumentation script like this:

my $ssh = Net::OpenSSH->new("$username:$password\@$ip", timeout => 30 +); $ssh->error and die "unable to connect to remote host: ". $ssh->error +; my @ls = $ssh->capture("ls"); $ssh->error and die "remote ls command failed: " . $ssh->error;

and that works, but all I get is commands from unix like systems "ls" "cat" etc. i want to run commands that work when i connect to the router by hand like "arp show". How to achieve that?

Replies are listed 'Best First'.
Re: Using Net::OpenSSH
by salva (Abbot) on Oct 06, 2017 at 07:58 UTC
Re: Using Net::OpenSSH
by thanos1983 (Vicar) on Oct 06, 2017 at 08:23 UTC
Re: Using Net::OpenSSH
by Anonymous Monk on Oct 05, 2017 at 20:24 UTC
    so what happens when you try those commands...?

      I don't remember exactly, but it says that it is unrecognizable command.

        when the doctor asks you what your symptoms are, is "i dont remember" an acceptable answer?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1200769]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-07-17 04:15 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (354 votes). Check out past polls.