I would like to detect and store server usage in any way possible. I currently use the TOP command to see the MYSQL CPU % used by the process and the overall server load, located at the top 1.22, 1.65, 1.98 for example. Is there anyway to detect and get these into a variables in PHP, i am aware of the time based microtime benchmark but thats not what i am after.
You can use the php system or passthru function to execute commands in the shell and get the output back.