Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Running Applications on a Remote Host

by Alatar (Beadle)
on Oct 01, 2001 at 19:55 UTC ( [id://115893]=perlquestion: print w/replies, xml ) Need Help??

Alatar has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

My problem is this. I am setting up a test platform on a Linux Box (RH7) to be used for running tests on remote hosts (Sun Stations). Because the remote hosts are running older versions of Perl and are not in my direct control, I want to be able to set up my Test environment locally and run the tests on the remote hosts. My scripts are run from the local host, but call applications on the remote hosts. I need to be able to run the remote app and return it's return code all from within my Perl script. I've looked into using rsh from within backticks, but I'm not sure if it will return values, and I'm having trouble getting permissions on the remote host.

So firstly, am I going the wrong way about this? Is there a cool and useful mod for doing just this that I'm not aware of?

And secondly, if not, where can I look for more help on rsh as the man pages are pretty sparse.

Thanks,
Alatar

Replies are listed 'Best First'.
Re: Running Applications on a Remote Host
by suaveant (Parson) on Oct 01, 2001 at 20:30 UTC
    If the remote systems have SSH I would suggest looking into Net::SSH::Perl by btrott

                    - Ant
                    - Some of my best work - Fish Dinner

Re: Running Applications on a Remote Host
by thatguy (Parson) on Oct 01, 2001 at 20:40 UTC
Re: Running Applications on a Remote Host
by MZSanford (Curate) on Oct 01, 2001 at 20:37 UTC
    I have used rsh via backtick's before, and it usually (depending on OS) returns correct results, but, other ways i can think of right away are :
    1. use Net::Telnet, though i often find i buggy
    2. use Net::SSH, i have never used it, as i do not use SSH, but i think it could also help.

    "They shall not overcome. Whoever told them that the truth shall set them free was obviously and grossly unfamiliar with federal law."
        -- John Ashcroft
      I urge you not to use telnet or the r* utilities as they provide no real security mechanisms

      Regards,
      C-Keen

Re: Running Applications on a Remote Host
by tommyw (Hermit) on Oct 01, 2001 at 20:47 UTC
    In the absence of a better solution (and I hope there is one!) how about making your remote command also echo its exit status, and then popping that off the end of the captured output?
Re: Running Applications on a Remote Host
by sheridan3003 (Beadle) on Oct 02, 2001 at 21:57 UTC
    A way you might want to do this is setup a "small server" on the remote host to run your app and return the results. Look at IO::Socket. Create a server that accepts the connection then runs the application capturing all of the output. The when the application is done send the results back through the socket. If you are worried about security or encryption look at the Net::SSL package (I Believe) for doing encrypted socket communication. This is one way to approach the problem.
      You might also look into the RPC::XML or SOAP::Lite modules for creating your own server to handle requests.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found