Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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 (Priest) 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2018-01-23 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (248 votes). Check out past polls.

    Notices?