From owner-freebsd-questions Mon Mar 25 9:39: 1 2002 Delivered-To: freebsd-questions@freebsd.org Received: from blacklamb.mykitchentable.net (207-173-241-155.elk.frontiernet.net [207.173.241.155]) by hub.freebsd.org (Postfix) with ESMTP id F3E2B37B417 for ; Mon, 25 Mar 2002 09:38:54 -0800 (PST) Received: from tagalong (unknown [165.107.42.248]) by blacklamb.mykitchentable.net (Postfix) with SMTP id C8DD5EE65A; Mon, 25 Mar 2002 09:39:06 -0800 (PST) Message-ID: <006201c1d423$ee01be00$f82a6ba5@lc.ca.gov> From: "Drew Tomlinson" To: Cc: References: <3C9E0754.2010104@verizon.net> Subject: Re: Showing Uptime Via webpage Date: Mon, 25 Mar 2002 09:38:51 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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 ----- Original Message ----- From: "Simon Morton" To: "Steven Lake" Cc: Sent: Sunday, March 24, 2002 9:05 AM Subject: Re: Showing Uptime Via webpage > 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. I tried this just out of curiosity but ran into problems. I don't get any errors but I just get a blank web page. Here is a clip from my httpd-access log: xxx.xxx.xxx.xxx - - [25/Mar/2002:09:32:15 -0800] "GET /cgi-bin/uptime HTTP/1.0" 200 0 And here are the permissions on the script: blacklamb# ll total 1 -rwxr-xr-x 1 root wheel 79 Mar 25 09:30 uptime I have another script there that I picked up along the way to verify that cgi was working. You can see the output at these URLs: http://mykitchentable.net/cgi-bin/uptime http://mykitchentable.net/cgi-bin/test-cgi I have basically no experience with either Perl or cgi. What is missing? Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message