Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sun Dec 16, 2018 5:46 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Game Server Reporting - UT2004, QW, BF1042, BFV, COD, HL
PostPosted: Mon Apr 12, 2004 10:54 am 
Offline

Joined: Tue Apr 06, 2004 6:42 pm
Posts: 5
For my game server hosting and community website I've assembled a group of scripts that will query specified game server and log their current player count, and max players. Since I put a lot of effort into it, I thought I'd contribute back. Enjoy!

Notes:
Some of these scripts require that qstat be installed. Some of the code for the Battlefield scripts was taken from the bfserverstats project over at sourceforge http://sourceforge.net/projects/bfserverstats.


Attachments:
File comment: The scripts and XML config.
game_server_scripts_and_xml.zip [17.53 KiB]
Downloaded 3309 times
File comment: A graph of a single server.
game_server_graph.png
game_server_graph.png [ 7.02 KiB | Viewed 45415 times ]
File comment: Showing multiple servers worth of info at once. purdy, purdy...
game_servers_graph.png
game_servers_graph.png [ 13.76 KiB | Viewed 45415 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 11:11 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
This is awesome! I was actually looking at getting something similar going. The only problam I seem to have is that the game server I'm trying to graph doesn't seem to have a way to poll via networking. (It's Delta Force 1) I need to run an application that grabs values from memory while the application is running.

I was going to modify BAB.stats to see if I could get it's information into Cacti...

Anyone else done anything similar? Once I get it done, I will post it here.

_________________
uname -a


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 12:31 pm 
Offline

Joined: Tue Apr 06, 2004 6:42 pm
Posts: 5
If the game has an in game browser or is support by All Seeing Eye then I'm sure it has some protocol to query for the stats. Search google and you might get lucky.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 12:57 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
Turns out that qstat supports Delta Force after all... using -sms option... but I can't seem to get it working.

_________________
uname -a


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 11:13 am 
Offline

Joined: Tue Apr 06, 2004 6:42 pm
Posts: 5
Something like this should work:

Code:
#!/usr/bin/perl

my $address = shift;
$response = `qstat -raw __  -sms $address`;
@response = split('__',$response);
print "player_count:".$response[5]." ";
print "max_players:".$response[4]." ";



Make sure that you have execute file permissions on the file. Then make sure that that qstat command line works.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 2:37 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
Well althought -sms is supposed to be Delta Force, I keep on getting a Timeout... I don't know exactly what's wrong.

_________________
uname -a


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 10, 2004 3:21 pm 
Offline

Joined: Wed Apr 14, 2004 12:27 pm
Posts: 23
This is a great addon :)
I'm using it without a problem for my Call of Duty server,
but Battlefield Vietnam is giving a problem.

the maximum players surrent: keeps saying 'nan' :S
The other values are all saying '0' and when i join the server it goes to '1'.

any idea what might be the problem? and maybe how to fix it ;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 4:47 pm 
Offline

Joined: Mon May 31, 2004 3:55 pm
Posts: 3
InfInIte wrote:
This is a great addon :)
I'm using it without a problem for my Call of Duty server,
but Battlefield Vietnam is giving a problem.

the maximum players surrent: keeps saying 'nan' :S
The other values are all saying '0' and when i join the server it goes to '1'.

any idea what might be the problem? and maybe how to fix it ;)


It is because PHP is outputting a "Powered-By-PHP" header in the script output which would interfer with the first data value i.e. Max_players.

To fix you should modify the data input Method from

Code:
php <path_cacti>/scripts/bfv_query.php <address>


to

Code:
php -q <path_cacti>/scripts/bfv_query.php <address>


Hope that helps


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2004 10:14 pm 
Could someone post their Graph Templates? They aren't getting created on my install... :-(

Thank You! :D


Top
  
 
 Post subject:
PostPosted: Sat Jul 10, 2004 1:37 pm 
Offline

Joined: Fri Jul 09, 2004 9:52 am
Posts: 19
is it just me or is the zip file corrupt.

after importing the XML

here is what i get for the data input method

perl &lt;path_cacti&gt;/scripts/bf_query.pl &lt;address&gt;

i had to edit to look like this perl <path_cact>/scripts/bf_query.pl <address>

I think some of the other XML is corrupt also..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 10:15 am 
Offline

Joined: Fri Jul 09, 2004 9:52 am
Posts: 19
I must have some setting wrong

Can anyone help?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 8:26 pm 
Offline

Joined: Fri Jul 09, 2004 9:52 am
Posts: 19
ok I think I found the problem

when I rum cmd.php for the command line the script works
Quote:
update /home/chicago/public_html/cacti/rra/eagle7_max_players_129.rrd --template player_count:max_players N:0:24


but when cron runs the command the games scripts dont work

Quote:
update /home/chicago/public_html/cacti/rra/eagle7_max_players_129.rrd --template player_count:max_players N::


whgat could be wrong ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2004 8:47 pm 
Offline

Joined: Fri Jul 09, 2004 9:52 am
Posts: 19
Validating the path and updating the script with the absolute path for qstat did the trick.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 2:35 pm 
guys how do i actually go about installing this, i simply wanna pole graphs for 2 half life game servers.

I've copied over the .pl file to the scripts folder, can anyone help, im quite a cacti noob.


Top
  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 3:00 pm 
lol i done my best and imported the .xml

but im getting:

RRDTool Says:

ERROR: can't parse '#942D0C:Natural Selection'

Im only trying to get some graphing of player count on a cs server, nothing too difficult, any help is appreciated.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group