grokstat

command module
v0.0.0-...-54c7037 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2017 License: GPL-3.0 Imports: 20 Imported by: 0

README

GrokStat

Build Status Docker Pulls

Retrieves information about game servers. Inspired by QStat, written in Go. Yet even more simple, extensible and fast.

GrokStat accepts input data as JSON via stdin. The result is displayed in JSON form as well. In order to run a simple query you need to specify protocol and array of hosts to check. Please refer to the example below for more information.

The server query is asynchronous, done via inbuilt UDP server.

Protocols

M stands for master server support. S stands for individual game server query support.

Supported
  • M S | Quake-derived games:
  • Quake II
  • Quake III
  • Xonotic
  • OpenArena
  • Warsow
  • Unvanquished
  • Soldiers of Fortune 2
  • M S | OpenTTD
  • M S | Teeworlds
  • M S | Steam / SourceQuery
  • S | Mumble

Get it

Docker (simple)

GrokStat project ships Docker images containing precompiled GrokStat, runnable out-of-the-box.

Install / update
docker pull vorot93/grokstat
Run
docker run -it --rm vorot93/grokstat <json-input>
Manual

In addition to using docker you can compile and run manually.

Dependencies
go get -u github.com/BurntSushi/toml github.com/jteeuwen/go-bindata/...
GrokStat itself
git clone https://github.com/grokstat/grokstat.git
cd grokstat && make build
bin/grokstat

Example

Query servers
docker run --rm grokstat/grokstat '{"hosts": {"openttdm": ["master.openttd.org:3978"], "q3m": ["master3.idsoftware.com"]}}'

or

echo '{"hosts": {"openttdm": ["master.openttd.org:3978"], "q3m": ["master3.idsoftware.com"]}}' | bin/grokstat

or

bin/grokstat '{"hosts": {"openttdm": ["master.openttd.org:3978"], "q3m": ["master3.idsoftware.com"]}}'

Always mind the single quotes.

Review available protocols
docker run --rm grokstat/grokstat '{"show-protocols": true}'

or

echo '{"show-protocols": true}' | bin/grokstat

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Documentation

Overview

grokstat is a tool for querying game servers for various information: server list, player count, active map etc

The program takes protocol name and remote ip address as arguments, fetches information from the remote server, parses it and outputs back as JSON. As convenience the status and message are also provided.

grokstat uses JSON input instead of command line flags. The JSON input is structured as follows:

hosts - map of string keys and string array values - hosts to query
show-protocols - boolean - if true, show protocols and exit
output-lvl - int - tune the output from bare JSON to full-fledged debug
custom-config-path - path of custom config file to be used

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL