View previous topic :: View next topic |
Author |
Message |
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Sat Jun 14, 2008 1:57 Post subject: NWN2 player count historical graphs for cacti |
|
|
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 |
|
|
abraxas77
Joined: 17 Nov 2006 Posts: 15
|
Posted: Thu Jun 19, 2008 2:30 Post subject: |
|
|
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 |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Sat Jun 21, 2008 6:32 Post subject: |
|
|
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 |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Sat Jun 21, 2008 19:52 Post subject: |
|
|
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 |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Sun Jun 22, 2008 7:08 Post subject: |
|
|
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 |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
|
Back to top |
|
|
|