I have a script that copies out another perl script to a remote machine and i want to execute it locally on the remote machine
I am not entirely sure what you mean by this.
If you are refering to
this thread,
perrin mentioned a cgi wrapper or SOAP. I'll elaborate.
You can set up a website on the remote server - if it's Win2k, then IIS is installed, or you can install
Apache. Whichever you use, make sure your servers have all the latest security patches.
On this remote website you have a simple CGI script which will execute a "selection" of programs - or the program you just copied. make sure that it's not allowed to execute any old program.
Your local script then executes the remote script using
LWP. I.e. you POST or GET the URL of the script on the remote webserver.
I know you mention no SOAP, but if Perl is installed on the remote machine,
SOAP::Lite is installed with it (at least I think it is with
AS Perl. And
it's not too difficult to use SOAP
Error: Keyboard not attached. Press F1 to continue.
Update: If Perl is not installed on all 300 of the remote machines - then this will not work (Not to mention that it would take days to set up 300 websites for this!!!). Also, if you are ruling out WMI, then I don't think there is a Perl solution (not that WMI has anything to do with Perl!). In which case check out
psexec as I
mentioned in your previous question. With psexec, it can be as simple as:
use strict; # etc...
my @servers = ("\\\\server1", "\\\\server2", "\\\\server3");
foreach my $server (@servers)
{
my $error = system ("psexec", $server,
"-u", "username", "-p", "password",
"remote_program name");
warn "failed to execute on $server ($error), $!"
if $error;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.