|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
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. Code:
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! Code:
#!/bin/tail -n+2 Content-type: text/plain ==== Start of Log ==== Last edited by DGPickett; 09-10-2012 at 05:19 PM.. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
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 ![]() |
|
#4
|
|||
|
|||
|
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.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send HTML body and HTML attachment using MUTT command | vickramshetty | Red Hat | 2 | 05-11-2010 10:33 AM |
| Run shell commands via HTML webpage/button? | zeekblack | Shell Programming and Scripting | 3 | 11-10-2008 11:15 AM |
| formatting output in html | ebbtide | Shell Programming and Scripting | 4 | 08-03-2006 10:02 PM |
| which access right should set in my webpage index.html ? | zp523444 | UNIX for Advanced & Expert Users | 1 | 11-13-2005 01:27 AM |
|
|