UNIX Automation - Output of a command on a webpage

prav83 used Ask the Experts™
I need some help in the building tools which involves outputting the script output to a Webpage, I am looking for Procedure and Process that might involve in building this automation tool -

The tool when complete should output something like this on the  webpage, This data will updated monthly. Sample out put on a webpage

Server           Month(April)
server1         6100-tl6-sp3
server2         7100-tl2sp1

Next month the output should look like

Server           Month(April)             Month(May)
server1         6100-tl6-sp3            6100-tl6-sp6
server2         7100-tl2sp1              7100-tl2sp1

the output for April and May is the operating system level.

So can someone guide me ..????????
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Topic Advisor
Most Valuable Expert 2016
Hi, think I can help you with this, do you already have a script that creates the requested output? If you so can just write a simple shell script that creates the HTML file for you. The script would write the HTML header first, then the output (add <BR> at end of each line and finally write the HTML close tag(s). It this something that could work for you?
-->>I need some help in the building tools which involves outputting the script output to a Webpage

1. You need a webserver/app server to host the website/application or to display the output of the page in a webpage like html or any jsp.

2. You need to format your shell script in a way such that it supports the display

As expert Gerwin suggested you better prepare the script in a html format and install an apache server(if there is not one by default) to support the requirement of web page

There is an module in Apache (Called CGI) which can help you in this regard, place the unix commands in such a way that they form a cgi script , placing script in cgi-bin folder you can achieve your desired result

More info on configuration of CGI module can be read from this


A Sample illustration of CGI script is shown here.

Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Have you written (part of) some script already? If so, can you post that?

When you're looking that the process part: I'd use one or 2 cron jobs to schedule creating your HTML file. One for getting the data and another for creating the output. So one job would collect the OS level for the servers. We would need to get that information using a remote call in some way or is that information already stored somewhere?

How and where do you want the HTML output to be published? On one of the servers or on a separate (reporting) machine?
Top Expert 2007

The most simple form is to do

(echo "<pre>"; /path/to/your/script; echo "</pre">) >/path/to/webpage.html

Open in new window


thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial