Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: best method in perl to execute command on remote server and fetch its output

by moritz (Cardinal)
on May 24, 2015 at 13:09 UTC ( [id://1127584]=note: print w/replies, xml ) Need Help??


in reply to best method in perl to execute command on remote server and fetch its output

Regardless of the programming language you use, and regardless of questions of convenience, you should use ssh. In contrast to both rsh and telnet, it can be secure.

On the perl side of things, Net::OpenSSH has a pretty good reputation. It's ->capture method lets you retrieve the output of a remote command, so it seems to fit your requirements.

Replies are listed 'Best First'.
Re^2: best method in perl to execute command on remote server and fetch its output
by janasec (Sexton) on May 24, 2015 at 14:46 UTC

    thanks for the quick reply

    please can you simple give a working example using the module Net::OpenSSH ,I checked the perldoc for the same but could not find a solution to ssh with username and password and run the command and gather output

    Thanks in advance

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1127584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2024-03-28 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found