From owner-freebsd-questions Sun Mar 24 9: 6:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from out020.verizon.net (out020pub.verizon.net [206.46.170.176]) by hub.freebsd.org (Postfix) with ESMTP id 7EFA637B400 for ; Sun, 24 Mar 2002 09:06:11 -0800 (PST) Received: from verizon.net ([141.157.161.99]) by out020.verizon.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20020324170610.MTQH5495.out020.verizon.net@verizon.net>; Sun, 24 Mar 2002 11:06:10 -0600 Message-ID: <3C9E0754.2010104@verizon.net> Date: Sun, 24 Mar 2002 12:05:24 -0500 From: Simon Morton Reply-To: smorton@acm.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en,pdf,zh-CN,de-DE,zh-TW,zh, zh- MIME-Version: 1.0 To: Steven Lake Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Showing Uptime Via webpage References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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