Here’s another script that may interest some of you – the SERVER LOAD script.
Yup, what more a convenient way to monitor the load of the server you’re on! Many have requested this script so here it is……
1 2 3 4 5 6 7 8 9
<?$loadresult = @exec('uptime'); preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $loadresult,$avgs); $svrld=(($avgs/8)*100); $data .= "Server Load is $svrld%\n"; echo $data; ?>
Easy isn’t it?
Now all you need to do is EDIT line #5. In my case, the server runs on an 8 core processor system so the number is 8. Just change the number to whatever the # of processor core that is on the server you’re on. (Don’t ask me! Find out from your host!).
Line #7 is the output that line #8 is going to produce, so just edit like #7 any way you like, just leave the $svrld% there.
Give it a try! 🙂
*It works on servers with Intel processor.
*It doesn’t work on Windows-based web hosting.
*It would not work if the administrator disabled the function.
Remember, don’t blame me if it doesn’t work on your hosting plan.