Web Hosting Talk







View Full Version : What's a good Server Uptime Script?


CYW-Justin
02-23-2003, 06:21 PM
Hi,
What's a good server uptime script / system info script? Possibly free? I'd like to play around with one to see how my servers are coming along. I tried doing a search on WHT, but a bunch of weird results came up. Maybe I searched incorrectly.. oh well. Anyone have any recommendations on some good ones?

Thanks :).

cubision
02-23-2003, 06:40 PM
phpsysinfo.sourceforge.net is a pretty popular, it gives information about the server in a nice output.

Not sure if that's what you were looking for.

If you search around on some php sites, you can usually find one.

CYW-Justin
02-23-2003, 06:46 PM
PHPSysInfo would be good at displaying my server information. Thanks. :) But I am also looking for something to record and display my server up time. Like it shows a 99.90% uptime for example. Know where I could find one of those?

conanqtran
02-23-2003, 06:52 PM
i use internetseer, its a free service, send you a report about your website every week, with % up time, Outages, Time on error etc...it also sends you alert when ur site is unreachable or errror..

CYW-Justin
02-23-2003, 07:03 PM
With internetseer could I put it on my website so the public could view my uptime? I am looking for something that could do that.

conanqtran
02-23-2003, 07:13 PM
i am not sure, they send me email every week though, maybe you will have to pay if you want to display the stats on your website? just check them

last time i use this scrip to display uptime on my forum, but now my provider doesn't allow one of the function that the require to run this script, however, just give it a try


<?
$text['minutes'] = "minute";
$text['hours'] = "hour";
$text['days'] = "day";

function uptime ()
{
global $text;
$fd = fopen('/proc/uptime', 'r');
$ar_buf = split(' ', fgets($fd, 4096));
fclose($fd);

$sys_ticks = trim($ar_buf[0]);

$min = $sys_ticks / 60;
$hours = $min / 60;
$days = floor($hours / 24);
$hours = floor($hours - ($days * 24));
$min = floor($min - ($days * 60 * 24) - ($hours * 60));

if ($days != 0) {
$result = "<b>$days</b> ".$text['days']." ";
}

if ($hours != 0) {
$result .= "<b>$hours</b> ".$text['hours']." ";
}
$result .= "<b>$min</b> ".$text['minutes'];

return $result;
}


echo uptime();

?>

CYW-Justin
02-23-2003, 07:27 PM
May I ask what function was not allowed by your provider?

RandallKent
02-23-2003, 08:03 PM
Most likely the
fopen('/proc/uptime', 'r');
due to safe mode restrictions.

cubision
02-23-2003, 08:09 PM
What do you mean by "safe mode" restricitons.

Under any normal circumstances, /proc/uptime is available to all users. The same can get achieved by running "uptime"