Jump to content


This topic is now archived and is closed to further replies.


Check Server Load

Recommended Posts

Hey guys

I want to monitor some tings on my server

Does anyone know how to check Server Load

I am running
(and should be running 5.1.4 tomorrow)

I know how to check the Uptime
<?php $data = shell_exec('uptime'); $uptime = explode(' up ', $data);
$uptime = explode(',', $uptime[1]); $uptime = $uptime[0].', '.$uptime[1];
echo (''.$uptime.''); ?>

But I want to check Server Load (Yes, the whole server)
and is it possible to monitor Bandwidth on a certain page as well
(maybe add a lil script which gets the server load, and stores to a DB or something)

Share this post

Link to post
Share on other sites
This will get the server load.

$loadavg_file = @file_get_contents('/proc/loadavg');
$loadavg_file = explode(' ',$loadavg_file);
$loadavg = trim($loadavg_file[0]);

$uptime_exec= explode(' ',@exec('uptime'));

$loadavg= $uptime_exec[count($uptime_exec)-1];
else {
$loadavg= '--';

echo "Server load: {$loadavg}";

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.