Added a function in AppModel to check the System Load

This commit is contained in:
Kyle Johnson 2013-09-11 09:22:53 -04:00
parent c41810bbf1
commit 646b511cd4
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,15 @@ class AppModel extends Model {
$return = exec( $string );
return $return;
}
function getSystemLoad()
{
$uptime = shell_exec( 'uptime' );
$load = '';
if ( preg_match( '/load average: ([\d.]+)/', $uptime, $matches ) )
$load = $matches[1];
return( $load );
}