Remotely check CPU, memory and disk space IBM Bluemix PHP instance.
I have a php instance running in IBM Bluemix.
Now I want to check the CPU, Memory and Disk Space from an external program by calling a php web page.
For CPU I tried the following function:
function get_server_cpu_usage(){
$load = sys_getloadavg();
$cores = shell_exec("grep 'model name' /proc/cpuinfo | wc -l");
$load[2] = ($load[2] / $cores) * 100;
return $load[2];
}
For Memory I use the following function:
memory_get_usage(true)
For Disk Space I use the following function:
disk_free_space("/")
But when I compare these results with the results provided by the IBM Bluemix Console, they are different.
Is there a correct way to externally monitor these values?