Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

CGI page to ssh to another host and trigger a perl script and return back the response

by chidori (Novice)
on Jun 29, 2014 at 02:27 UTC ( [id://1091596]=perlquestion: print w/replies, xml ) Need Help??

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

Hi ,

I have a requirement to create a CGI page , where i have to execute a set of perl scripts in sequence.

If A,B,C,D are the perl scripts to be executed in sequence. 'B' should be started only if 'A' script succeeds.

I am planning to use Net::OpenSSH module for this. Couple of questions in my mind for which i don't have answer.

When script is getting executed , I think it would be wise to let the user know of whats happening in the background. Would it be possible to capture the script output and send it back to cgi page . Be it success/failure , the script should send the log output to the cgi page for the user view. In addition , when it is success , script should trigger the next script in sequence as well.

But I am not sure, how to capture the output and exit status and based on the result trigger the next script in sequence

I feel a html table like one shown below, to display the execution progress would be good.
SCRIPT_NAME STATUS LOG
A Success click_here
B Inprogress Inprogress

Apache server is setup in such a way , anyone who runs the script , it will executed as one common user. So there won't be a problem of permissions.

Other than this , to my knowledge , I don't see any other issue that I have to address. But my instincts say there might be few other things that i am missing .

Can someone please give me some heads up on this.

  • Comment on CGI page to ssh to another host and trigger a perl script and return back the response

Replies are listed 'Best First'.
Re: CGI page to ssh to another host and trigger a perl script and return back the response
by choroba (Cardinal) on Jun 29, 2014 at 08:03 UTC
      Thanks , will look into the thread.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found