There is a perl library that can run rcon on a server.

http://www.gruntle.org/projects/hl2/Rcon-HL2-0.05.tar.gz

I use this small script to get info from a server.

=====================================================
#!/usr/bin/perl

use Rcon::HL2;

my $command = shift @ARGV; # bring in the title from argv

my $rcon = Rcon::HL2->new(
      hostname => "XX.XX.XX.XX",
      password => "rconpasshere",
);

$rcon->run("$command");
print $rcon->response();
=====================================================
For instance:
$ perl rcon.pl stats
0CPU   In    Out   Uptime  Users   FPS    Players
  0.00  0.00  0.00    3976     8  124.35       0

This can be easily greped and parsed.


On Apr 23, 2009, at 1:24 PM, Carl wrote:

> you could check it yourself by using an rcon script.  Rcon into the
> server, run the stats command, capture the output, and then compare it
> to top.  I would suggest running top just before grabing the cpu load,
> rconing in and grabbing cpuload, and then again afterwards.
>
>
> Here is the C Source: http://www.asyserver.com/~cstrike/rcon.c
>
> Or if you prefer python:  http://sourceforge.net/projects/srcdspy/
>
>
> Saint K. wrote:
>> Hi,
>>
>> Does anyone know if the output value on the CPU load of a server is
>> correctly reported when you type 'stats' ?
>>
>> We're currently creating graphs on the CPU load using 'top' as  
>> reference
>> data, but as we also query the server for total player numbers and
>> server FPS it would be more easy to also draw the CPU load from there
>> instead of using top.
>>
>> Cheers,
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list  
>> archives, please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlds_linux
>>
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list  
> archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlds_linux

f0rkz
f7lans.com - Not your moms marble madness


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to