Code: Select all
function getLoad()
{
$uptime = shell_exec( 'uptime' );
$load = '';
if ( preg_match( '/load average[s]{0,1}: ([\d.]+)/', $uptime, $matches ) )
$load = $matches[1];
return( $load );
}
Code: Select all
function getLoad()
{
$uptime = shell_exec( 'uptime' );
$load = '';
if ( preg_match( '/load average[s]{0,1}: ([\d.]+)/', $uptime, $matches ) )
$load = $matches[1];
return( $load );
}