Teamspeak metrics for Prometheus
The Python script starts an HTTP-server, which exposes the Prometheus metrics & queries a given TS3 server via Teamspeak's ServerQuery procotol at an interval. The metrics provided by Teamspeak aren't convertered and passed as they are.
- Python 3
- PIP
- Clone this repository
cd
into the cloned repository- Run
pip install -r requirements.txt
Bonus points: use virtualenv
List all arguments with python -h
Name | Description | Default value |
---|---|---|
--ts3host |
Hostname or ip address of TS3 server | localhost |
--ts3port |
Port of TS3 server | 10011 |
--ts3username |
ServerQuery username of TS3 server | serveradmin |
--ts3password |
ServerQuery password of TS3 server | |
--metricsport |
Port on which this service exposes the metrics | 8000 |
Example: python app.py --ts3host example.com --ts3port 12345 --ts3username ExampleUser --ts3password SomePassword --metricsport 8080
- Docker
With docker:
docker run -d -p 8000:8000 -e TEAMSPEAK_HOST='123.123.123.123' -e TEAMSPEAK_PASSWORD='example123' tilmannf/teamspeak-prometheus
With docker-compose:
services:
teamspeak-prometheus:
image: teamspeak-prometheus:latest
environment:
TEAMSPEAK_HOST: 123.123.123.123
TEAMSPEAK_PASSWORD: example123
ports:
- 8000:8000
Name | Description | Default value |
---|---|---|
TEAMSPEAK_HOST |
Hostname or ip address of TS3 server | localhost |
TEAMSPEAK_PORT |
Port of TS3 server | 10011 |
TEAMSPEAK_USERNAME |
ServerQuery username of TS3 server | serveradmin |
TEAMSPEAK_PASSWORD |
ServerQuery password of TS3 server |
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- example.com:8000
Import grafana-dashboard.json
or Grafana dashboard ID 123
for a demonstration of some of the metrics.
Teamspeak is a registered trademark of Teamspeak Limited. This project is not endorsed by or affiliated with Teamspeak Limited in any way.
This project is licensed under the terms of the MIT license.