SA-MP Forums Archive
Retrieving RAM/CPU usage with PHP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Retrieving RAM/CPU usage with PHP (/showthread.php?tid=307621)



Retrieving RAM/CPU usage with PHP - Ironboy500[TW] - 31.12.2011

Hello

I'm creating admin panel for my server with PHP, and I'd like to echo current RAM and CPU usage of server.
Server is running on linux Debian 5 VPS, any help is appreciated.


Re: Retrieving RAM/CPU usage with PHP - RyDeR` - 31.12.2011

Use phpSysInfo library.


Re: Retrieving RAM/CPU usage with PHP - Ironboy500[TW] - 31.12.2011

Thank You!


Re: Retrieving RAM/CPU usage with PHP - Ironboy500[TW] - 31.12.2011

Sorry on double post, but I'm trying to retrieve samp03svr process RAM/CPU usage, not usage of whole VPS.


Re: Retrieving RAM/CPU usage with PHP - Face9000 - 31.12.2011

Quote:
Originally Posted by Ironboy500[TW]
Посмотреть сообщение
Sorry on double post, but I'm trying to retrieve samp03svr process RAM/CPU usage, not usage of whole VPS.
You want echo your gamemode CPU/RAM usage?

If yes,i'm with you,i wanna know how to echo too...


Re: Retrieving RAM/CPU usage with PHP - RyDeR` - 31.12.2011

You can retrieve data from a single process with that library I guess. Didn't really check it though so I may be wrong.


Re: Retrieving RAM/CPU usage with PHP - Ironboy500[TW] - 31.12.2011

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
You can retrieve data from a single process with that library I guess. Didn't really check it though so I may be wrong.
I just checked it out. It displays general information on your system together with CPU/RAM usage.
But not for a single process. And I'm also looking for a custom code because I'm willing to include it into my admin panel.


Re: Retrieving RAM/CPU usage with PHP - Gamer_Z - 31.12.2011

simple ****** for some linux commands, eg "retrieve linux process memory usage",
http://www.cyberciti.biz/tips/howto-...y-program.html

then use the php send command equillivant and echo it. Simple.