[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] OT: Showing uptime via web



At 09:54 PM 8/21/00 -0700, Patrick Beart wrote:
 >	Hey, why not throw out the script that you are using - with
the limitations described, above - for everyone? Might be fun to use
this in an include(SSI) tag. Should work.

	I'd like to see the CGI script for this. Would you Email me?


At 10:12 PM -0700 8/21/00, Cody Watkins wrote:
This is it below:
------------------------------------------

#!/usr/bin/perl

chop($uptime = `uptime`);
@_=split(" ",$uptime);
$updays=@_[2];
$uphours=@_[4];
print ("Content-Type:text/html\n\n");
print "This server has been up for $updays days and $uphours hours.";
exit;

--------------------------------------

Hope it works for you.



I think that it works splendidly. Take a look at the "Performance" section of this page. (http://www.iWeb4Biz.com/what.shtml) There is a comma after "hours" (in bold type). I'm guessing that it is the one that is coded into the "split" function (2nd line), but I'm not a PERL architect.

Anyone else that wants to call this nifty script can "view source" to see the SSI call.

Thanks, Cody. Now, can you help me figure out how to kill the comma on this thing? ; )



Patrick Beart
--
-------------------------------------------------------------------
patrick@xxxxxxxxxxxxxxxxxxx       503-558-8322      Clackamas(Portland), OR
Web Architecture:   http://www.WebArchitecture.com
Intelligent Internet consulting, site development, and hosting solutions since 1994

* Founding MEMBER --  Internet Professionals Northwest. (www.ipn.org)
* MEMBER -- Webmaster's Guild/ Association of Internet Professionals
 -------------------------------------------------------------------