F1RULZ
April 20th, 2002, 15:29
say what the CPU load is.
robin
April 23rd, 2002, 21:32
if you're using php >= 4.00 on a *nix server, you can do something like this:
$upstr = shell_exec("uptime");
echo $upstr;
the contents of $upstr = the output of the "uptime" command, which tells you what time it is, how long the computer's been running, how many users are on the system, and the system load averages (you get three numbers - the load averages in the last 1, 5, and 15 minutes. if you want, you can do some string manipulation here and there to get just the load averages.
this might not work on some free servers. people tend to disable exec()-type commands as a security precaution.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.