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


 
Thread Tools Search this Thread
Top Forums Web Development Get command-output to webpage from solaris-10-OS invoked from html webpages
# 1  
Old 09-04-2012
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
# 2  
Old 09-10-2012
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/\&/&amp;/g
    s/"/\&quot;/g
    s/</\&lt;/g
    s/>/\&gt;/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 06:19 PM..
# 3  
Old 09-12-2012
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 Smilie
# 4  
Old 09-13-2012
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Arranging the command output into an html table format

Hi, I need to format a command output for the beolow command: runmqckm -cert -list -db $MQ_KDB -pw $PASSWD -expiry $EXP | grep -v "Certificates in database" The output will be: "ABC - cert name" From: Tuesday, May 25, 1999 11:09:40 AM CDT To: Saturday, May 25, 2019 11:39:40 AM CDT ... (3 Replies)
Discussion started by: bdpl
3 Replies

2. UNIX for Dummies Questions & Answers

How to submit form on an php webpage from command line?

Hello, i have page domain.com/form.php the form fields on form.php are named: name=ipaddress name=port and submit button is named: submit i want to ask how the linux command will look like to submit the form filled with: ipaddress: 127.0.0.1 port: 80 I tried various curl and... (5 Replies)
Discussion started by: postcd
5 Replies

3. Shell Programming and Scripting

Formating output in html

Hi Guys, I was searching and landed up something here only. This is the code and I want the formatted html in email but that is not working, anybody knows the reason why? #!/bin/sh set -x DATE=`date -u` # Print beginning of webpage function html_header { cat <<END ... (5 Replies)
Discussion started by: bluemind2005
5 Replies

4. Solaris

Solaris 9 Zone : Date command in crontab shows delayed(One Hour) output

SOLARIS 9 Zone : date command in crontab shows delayed(One Hour) output Hi folks, the date command shows the correct date and time, How ever, if the date command executed through crontab in any form of scrip the output shows as one hour delayed, similar to date -u.. Can some one help in... (12 Replies)
Discussion started by: judi
12 Replies

5. Shell Programming and Scripting

Shell command output into HTML

Hi unix geeks out there, I have a file that contains the output of a command in text format ------------------------------------------------------------------------ r201535 | kashyapgiri@gmail.com| 2012-06-21 05:00:01 +0530 (Thu, 21 Jun 2012) | 1 line Changed paths: M... (8 Replies)
Discussion started by: Kashyap
8 Replies

6. UNIX for Dummies Questions & Answers

Output as a html file

Hi i want to store output in html file.but the problem is the html file already has its content..i want to append the new output to that html file..please suggest any new ideas...i m tryin to store the output in a textfile and append to that html file..but its nt workin..need ur help while... (6 Replies)
Discussion started by: navsan
6 Replies

7. Red Hat

Send HTML body and HTML attachment using MUTT command

Hi there.. I need a proper "mutt" command to send a mail with html body and html attachment at a time. Also if possible let me know the other commands to do this task. Please help me.. (2 Replies)
Discussion started by: vickramshetty
2 Replies

8. Shell Programming and Scripting

Run shell commands via HTML webpage/button?

Hey guys, I got a issue here... we have a development box and a UAT box that our webmasters use, they do the webpage development on the development box and and save changed files to a particular directory on the dev machine. At a certain time of the day a cronjob kicks off and the... (3 Replies)
Discussion started by: zeekblack
3 Replies

9. UNIX for Advanced & Expert Users

which access right should set in my webpage index.html ?

I have a webpage, http://my.dns.com/~zp523/index.html, I want all people to have read and execute privileges. I want to extend it with execute privilege. Which command should be used in chmod? is it only give read(r) & execute(x) parameter in 'chmod ??? index.html' thk a lot!! (1 Reply)
Discussion started by: zp523444
1 Replies
Login or Register to Ask a Question