FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Possible to get CPU load for computer?





Diablosblizz
I'm just wondering if it's possible to get the CPU load of the server the script is running on. This will be ran on my own server so need to worry about Frihost server's. I just want to know the CPU load because I am making a server status script so if the usage was over 20% then it would give me a critical error message on the page.

Just wondering if it's possible with PHP, because phpsysinfo script is able to get it, I just sort of want to implement this into my own script.

Thanks!
rvec
you can use system('uptime') if that's possible on your host (has to be linux and system() has to be allowed).
Diablosblizz
Nope, that's not possible. Sad Is there a equivalent for a Windows server?
kv
It is not so straight forward in windows. But here are few things you can try.

A vbscript which is found HERE. Modify it according to your requirements.

Or

Do some research on winapi GetSystemInfo
so that you can write a c program, compile it as command line app and invoke using the system() command in php.
Related topics
Bad Comptuer
Future of FriHost
Cron Jobs
HEAT problem
making backups
Programs in RAM
Win xp handling over 2gb of memory
Load scripts from another file
Upgraded my Processor and it keeps on restarting.
accesing my computer from home and share my internet conn
Python and CPU load
Random 100% CPU load for no apparent reason.
PHP: monitor computer activities
Using embedded HTML in Python?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.