logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWN2 player count historical graphs for cacti

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sat Jun 14, 2008 1:57    Post subject: NWN2 player count historical graphs for cacti Reply with quote

I whipped up a lil poller program and some cacti templates to go along with it to pull player counts from an NWN2 server using the typical GameSpy probe packet (a-la what the server browser uses in game).

Presently, I have only tested this with cacti on unix-like systems, but the poller program will build under Windows as well if you run cacti on Windows. (Where you run cacti and the poller app on has no bearing on where you run the game server, as it talks to the game server over the network.)

The end result is graphs on the order of those provided by nwn2.fr for all servers, but with the usual cacti goodness added on top (historical logging beyond just daily, graph zooming, etc.)

You can grab the source, binaries (Linux i386/amd64, Win32 x86/x64), and cacti templates here:

http://www.nynaeve.net/Skywing/nwn2/nwn2srvquery.tar.bz2
http://www.nynaeve.net/Skywing/nwn2/nwn2srvquery.zip

(Identical contents of each distribution.)

There is a readme file included, also posted here: http://www.nynaeve.net/Skywing/nwn2/nwn2srvquery_readme.txt

Also, source for the program has been committed to virusman's NWNX4 svn. However, the program doesn't really rely on NWNX4 in any way, and you could use it against a plain vanilla NWN2 MP server (though I doubt anyone would want to run such a thing on a dedicated basis).

The templates assume that the nwn2srvquery program is installed to /usr/local/bin/nwn2srvquery although you could edit them to change this path if you want. (Dirty, hardcoding paths, I know.)

The program prints a line to stdout as follows:

users:0 maxusers:64

(Where these are the user / max user counts grabbed via GameSpy).

The cacti templates tell cacti how to interpret this information and graph it.

It will wait a maximum of 10 seconds before giving up on waiting for a response and returning zero values. If you want to change this, then you will need to modify the program and recompile it.

Build instructions:

Windows: "cl nwn2srvquery.cpp" (from a VC++ command prompt)
Linux: "make"

Cacti configuration:

Just import the template .xmls and create a graph associated with a host and you should be good to go. It's also possible to create a graph for a server that you don't have an SNMP host configured in cacti for, but this requires that you just use the data query template as a base and manually input the server IP when setting the data query up in cacti.
Back to top
View user's profile Send private message
abraxas77



Joined: 17 Nov 2006
Posts: 15

PostPosted: Thu Jun 19, 2008 2:30    Post subject: Reply with quote

Do you by chance, masquerade once a year in sleigh wearing a fluffy red suit? ... because you keep bringing us these great gifts (this one not but a few weeks after my build team decided we wanted such an app. on our website). Thank you!

Cheers!
_________________
aka. twp_andrew

:: Lead Script Design :: The World of Paladium II ::
Back to top
View user's profile Send private message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Sat Jun 21, 2008 6:32    Post subject: Reply with quote

Wow nice.
I wish I would have known about cacti when I was looking to do something similar.

I wanted to display a histogram graph of the character levels on the server. I might have to see if I can do the graphing with cacti as the graphs look much better.

http://shadowofiniquity.game-host.org/worldstatus.php
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sat Jun 21, 2008 19:52    Post subject: Reply with quote

Glad somebody else found it useful!

Cacti is generally used to display record historical data that is steadily logged over time to a ring buffer. rrdtool is the program used by cacti which takes the logged data and prints out a nice graph for it (other things, e.g. MRTG, use rrdtool in similar capacities as well).

I don't think rrdtool is really designed for what you are looking for, but I haven't read through all of it's capabilities. You might check this: http://oss.oetiker.ch/rrdtool/

If you wanted to log character levels over time or something of that sort, then cacti/rrdtool might be more useful.
Back to top
View user's profile Send private message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Sun Jun 22, 2008 7:08    Post subject: Reply with quote

Yea, after I looked more in depth to the tool Cacti really isn't just a pure graphing tool as I thought it was. I'll stick with what I have; it work and doesn't look to bad either.
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Thu Sep 11, 2008 22:13    Post subject: Reply with quote

I updated my server demographics web page:
http://shadowofiniquity.game-host.org/worldstatus.php

It's kind of interesting to see what people like to play on a server. Anyone else look at this type of data on their servers?
_________________
Member Shadow of Iniquity development team
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group