Get command-output to webpage from solaris-10-OS invoked from html webpages

Hello,
I am a middleware administrator and as an admin I need to monitor a number of middleware instances (weblogic servers). But since it is a not the forum for that i would like to put my problem in simple terms and need guidance on that.
I need to use apache webserver on Solaris 10 zones to host a html site. The buttons on the html page will invoke shell-scripts/weblogic-mbean-commands/WLST-scripts using CGI , to get the required output on the webpage.
Apache htaccess will be required for authentication.

The restriction is that all the components should be free. Only Solaris 10 is affordable here.
Is it a feasible+practical solution ?
Is there any other better solution to this(which wont require any licensing products )?
Need your guidance.
Thanks,
Poga

CGI ouput goes to the web page by default, ok as content type text/plain but that is usually a bit drab; ok in a frame, maybe. Command output needs a little post-processing to be friendly to the middle of a text/html page in a <PRE> element.

echo '<PRE>'
 
( echo '$ command_line'
 
  command_line 2>&1
  echo '$'
 )| sed '
    s/\&/&/g
    s/"/\"/g
    s/</\</g
    s/>/\>/g
 '
 
echo '</PRE>
<HR>'

This might suffice for canned or minimal-input scripts. I you need to process input of any complexity, you probably want PERL or JAVA or such, as you need a URL-decode for input. There are wrappers and servers that put the form variables somewhere in the environment, so shell can more easily process them. I wrote one -- everything is a shell scripted service, form variable x becomes environmental variable $h_x. The log file is executable and starts with the f0llowing prefix so it is a service that can dump itself!

#!/bin/tail -n+2
Content-type: text/plain
 
==== Start of Log ====

Thanks DGPickett for your valuable input.
Did a little bit of R&D from my part and found out that the best way to implement would be using PERL-CGI scripting. So working on that now :slight_smile:

Yes, that's great for simple HTML. PERL can do sed substitutions. If you get confidential information or affect the server, you might want authentication and security. The scripts should be multi-user stable, like using $$ in temp file names or using pipes, and capable of running two at once or have a lock-out.