Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2002 12:05:24 -0500
From:      Simon Morton <simon.morton@verizon.net>
To:        Steven Lake <raiden@shell.core.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Showing Uptime Via webpage
Message-ID:  <3C9E0754.2010104@verizon.net>
References:  <Pine.GSO.4.44L0.0203232239500.14624-100000@shell.core.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Steven Lake wrote:
> 	Hi all.  Just a curiousity question.  If I wanted to have a
> special hidden page which showed me all of the current processes, total
> uptime, list of last logins, or other things like that which automatically
> refreshed each time I reloaded the page, how would I do that?  Do I make a
> perl script for that, or can I do it directly through Apache?  Kinda
> curious about this cause it would be nice if I could do that.

If you just want the basics, the following perl script will do the trick:

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
system ("uptime");
exit;

Put it in your cgi-bin directory, name it uptime, make it executable by 
httpd,
and you are all set.  Access it as http://your.server/cgi-bin/uptime.

Of course you can do this with other commands and, depending on your 
perl and HTML skills, make it as fancy as you want.

hth
simon
-- 
http://www.SimonMorton.com
smorton at acm dot org

"Money couldn't buy friends but
you got a better class of enemy."
        Spike Milligan (1918-2002)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C9E0754.2010104>