mojodaddy has asked for the wisdom of the Perl Monks concerning the following question:
If I were to summarize what I'm trying to do, I think it comes down to this: I would like to find a way to access the shell by manipulating an HTML form on a CGI web page.
I built a CGI "control panel" that I use to monitor various processes that run on my system. Basically the CGI queries a database and shows the results in tabular form on a web page served by localhost. (It's only used by me locally.) I have a nice big "refresh" button on it and throughout the day I update the page to see what's going on.
The processes themselves are perl scripts that I start and stop from the command line, and I use the data from the control panel page to decide what to start/stop and when.
It works, but it's become a bit unwieldly lately in the sense that I am having to keep multiple console windows open, and flipping through the windows to find the right one is a clumsy process. I tried running them as background processes that print their output to logfiles and then periodically doing a tail -f but the problem is if I don't see it, I tend to forget about it.
I am imagining enhancing my control panel page to allow me to start and stop each process via the HTML form, specifically with checkboxes. Checked, the program takes off running. Uncheck it and it stops.
And ideally (though I may be getting over my head here) some way to monitor the output like via tail. And I don't want to have to rewrite all the scripts to make them into CGIs! ;)[refresh] .=-----------=. | data | data | [X] <-- checkboxes |=-----+------| | data | data | [X] |=-----+-----=| | data | data | [X] '=-----------='
What I can't seem to figure out is how or whether a CGI can execute a non-CGI script. Something like :
and some sort of event handler, I guess, so that I can start/stop the processes by just changing the checkbox instead of having to "submit" the form.<form name="myform" action="not_a_cgi.pl" method="get"> <input name="checkme" type="checkbox"/></form>
Is any of this possible?
A slight aside: In one of my google searches (or maybe it was here on PM) I came across something like this:
<script type="text/perlscript">[perl code here]</script>
But when I tried it my Firefox browser just laughed at me. Is that some kind of old-school thing? :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI "control panel" app
by stonecolddevin (Parson) on Jul 24, 2007 at 03:25 UTC | |
by mojodaddy (Pilgrim) on Jul 24, 2007 at 04:14 UTC | |
by stonecolddevin (Parson) on Jul 24, 2007 at 08:16 UTC | |
by mojodaddy (Pilgrim) on Jul 24, 2007 at 12:21 UTC | |
by Anonymous Monk on Jul 24, 2007 at 05:16 UTC | |
by mojodaddy (Pilgrim) on Jul 24, 2007 at 05:40 UTC | |
|
Re: CGI "control panel" app
by Your Mother (Archbishop) on Jul 24, 2007 at 04:10 UTC | |
by mojodaddy (Pilgrim) on Jul 24, 2007 at 04:20 UTC | |
by jZed (Prior) on Jul 24, 2007 at 04:58 UTC | |
by mojodaddy (Pilgrim) on Jul 24, 2007 at 05:25 UTC | |
by scorpio17 (Canon) on Jul 24, 2007 at 14:19 UTC | |
by mojodaddy (Pilgrim) on Jul 25, 2007 at 02:06 UTC | |
|
Re: CGI "control panel" app
by leocharre (Priest) on Jul 24, 2007 at 13:19 UTC | |
by mojodaddy (Pilgrim) on Jul 25, 2007 at 02:19 UTC | |
by leocharre (Priest) on Jul 26, 2007 at 13:13 UTC |