This document explains how to set up a monitoring system for all the servers which report to a specific master server.
Unpack stats.tgz.
$ cd stats $ mkdir images $ mkdir data
Unpack Google Protobuf and you'll get, for example, protobuf-2.1.0. Go into it and install it. And then run:
$ ln -s protobuf-2.1.0/python/google google
This should generate server_pb2.py:
$ protoc server.proto --python_out=.
You have to change these to the absolute path to the stats directory:
$ grep /path/to/stats * count:STATS_DIR=/path/to/stats oass.py:DATA_FILENAME_TEMPLATE = '/path/to/stats/data/%Y%m%d%H%M.pb' plot:STATS_DIR=/path/to/stats
Edit oass.py and specify the master server and the protocols.
Start the monitoring:
$ crontab -e # Each 4 minutes, get a list of all the players. 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56 * * * * /path/to/stats/oass.py # Daily, at 06:02, plot the players and servers stats for the last 24 hours. 2 6 * * * /path/to/stats/plot 2>&1 >>/tmp/asdfaaaa.txt # Weekly, at 03:00, count the median number of players for the last week. 3 0 * * 1 /path/to/stats/count 2>&1 >>/tmp/bsdfaaaa.txt
The plot script will create daily images like these ones:


All the daily images and weekly counts are written to the images directory. All the data is stored in data.