LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-05-2004, 07:45 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
Server up time in html


I'm looking to add a web page to a site that wil display the output of the 'w' command, basically show the up time for the server.

All help and pointers appreciated.
 
Old 12-05-2004, 08:24 PM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
i believe you can run shell commands in a web programming language which allows scripting, html is for static content.
 
Old 12-05-2004, 08:29 PM   #3
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
you can use java to make a system call and display using jsp.
 
Old 12-05-2004, 11:02 PM   #4
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
You can create a simple CGI in several languages, here is one in bash.
Just put this in your cgi-bin directory, call it w.cgi
The go to the url http://address/cgi-bin/w.cgi
Code:
#!/bin/sh
echo "Content-type: text/html"
echo ""
echo "<html>"
echo "<head>"
echo "<title>Startup Mode</title>"
echo "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">"
echo "</head>"
echo "<body bgcolor=\"#C0C0C0\" text=\"#000000\" link=\"#0000FF\" vlink=\"#C00000\" alink=\"#FFFF00\">"
echo "<center><h2>Output of w command</h2></center><p>"
echo "<pre>"
w
echo "</pre>"
echo "</body>"
echo "</html>"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set and sync system time with time server?? servnov Linux - Newbie 6 12-03-2013 07:55 PM
X server freezes from time to time grayswander Linux - General 3 01-02-2005 10:43 AM
time syncing with time server turbo_acura Linux - Networking 2 10-24-2004 02:38 PM
How to syncronize my system time by public time server? hakansun Linux - Networking 1 09-10-2004 05:10 AM
Updating System time from some Inet time server Steave Linux - General 6 12-21-2001 02:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration