SA-MP Forums Archive
[Plugin] [REL][Linux]Get your servers load average - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL][Linux]Get your servers load average (/showthread.php?tid=260206)



[REL][Linux]Get your servers load average - MaXSpeeD - 07.06.2011

Well this a quick plugin I just whipped up that allows you to calculate the load average of what ever linux machine your server is running on. (Useful for debugging...) Since this plugin only comes with one function no include will be in the archive.

Install: (So simple a monkey could do it)
Place loadavg.so in your plugins directory then open your server.cfg and add this line twords the top if its not already there
pawn Код:
plugins loadavg.so
Now just go into what ever script you intend on using this for and add this line below your includes
pawn Код:
native Float:loadavg();
Heres an example of how to use this plugin in your gamemode/filterscript
pawn Код:
#include <a_samp>
native Float:loadavg();

main(){
     printf("System load average: %f",loadavg());
     return;
}
Download the attached .zip file for the compiled .so plugin and the plugin source.


Re : [REL][Linux]Get your servers load average - Hip-hop - 07.06.2011

Oh nice work !


Re: [REL][Linux]Get your servers load average - MaXSpeeD - 07.06.2011

thanks man


Re: [REL][Linux]Get your servers load average - linuxthefish - 07.06.2011

Nice, i've been looking for something like this

(I made one using the HTTP function in PAWN and PHP, though i'm useless at plugins)


AW: [REL][Linux]Get your servers load average - Meta - 16.06.2011

yeah, like linuxthefish already said, it's also possible via PHP etc... but how about an addition for the CPU Usage Value? (Also possible via PHP but more difficult)