Date: Mon, 25 Mar 2002 09:38:51 -0800 From: "Drew Tomlinson" <drew@mykitchentable.net> To: <smorton@acm.org> Cc: <questions@freebsd.org> Subject: Re: Showing Uptime Via webpage Message-ID: <006201c1d423$ee01be00$f82a6ba5@lc.ca.gov> References: <Pine.GSO.4.44L0.0203232239500.14624-100000@shell.core.com> <3C9E0754.2010104@verizon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Simon Morton" <simon.morton@verizon.net> To: "Steven Lake" <raiden@shell.core.com> Cc: <freebsd-questions@FreeBSD.ORG> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006201c1d423$ee01be00$f82a6ba5>