The Arcive of vBulletin Modifications Site. |
|
Server Load doesn't show up in Admin CP? Details »»
|
|||||||||||||||||||||||||||
The code is there
Code:
if ($stats = @exec("uptime")) {
$datecut=time()-$cookietimeout;
$guestsarry = $DB_site->query_first("SELECT COUNT(host) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
$membersarry = $DB_site->query("SELECT DISTINCT userid FROM session WHERE userid<>0 AND lastactivity>$datecut");
$guests = number_format($guestsarry['sessions']);
$members = number_format($DB_site->num_rows($membersarry));
$onlineusers = number_format($guests + $members) . " users online ($members members & $guests guests).";
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
echo "<tr class=\"secondalt\"><td>Server Load Averages</td><td><b>$regs[1], $regs[2], $regs[3]</b> $onlineusers</td></tr>\n";
}
Download Now
Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
It only works for *Nix servers (OS X, Linux, Unix). Windows doesn't support the "uptime" command.
|
|
#3
|
||||
|
||||
|
Hmm it says server type Linux, or am I just confused? XD
|
|
#4
|
|||
|
|||
|
Stupid question: are you sure it's a Linux server?
|
|
#5
|
||||
|
||||
|
I'm pretty positive that my site is on a Linux Server (my host is p4host.com)
|
|
#6
|
||||
|
||||
|
Your host needs to enable the showing of server loads. Contact your host.
|
|
#7
|
||||
|
||||
|
Thank you filburt & Erwin for your help, I'll definately ask
|
![]() |
|
|