Skip to content

an prometheus exporter for SRCDS based gameservers (like CSGO, TF2, L4D2, ...).

Notifications You must be signed in to change notification settings

OkayThereBud/srcds_exporter_hoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus SRCDS Exporter

This is an exporter for the Prometheus monitoring system. It exports data from SRCDS Gameservers (e.g. CSGO, TF2, L4D2, ...) via rcon. It uses the status and stats commands for this.

How to install:

  1. git clone https://github.com/991jo/srcds_exporter.git
  2. cd srcds_exporter
  3. python3 -m venv .
  4. source bin/activate
  5. pip install -r requirements.txt
  6. python3 main.py

How to query via Prometheus:

You can use the following example config. Please adjust the IP:port in the last row to the IP:port your exporter uses.

  - job_name: srcds

    scrape_interval: 5s

    metrics_path: /metrics

    static_configs:
          - targets: ["<ip>:<port>:<rconpassword>"]

    relabel_configs:
        - source_labels: [__address__]
          regex: "(.+:.+):.+"
          replacement: "$1"
          target_label: __param_target
        - source_labels: [__address__]
          regex: ".+:.+:(.+)"
          replacement: "$1"
          target_label: __param_password
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: 127.0.0.1:9200  # The real ip/port of the srcds_exporter

Basically you have to build this URL: http://<exporter-address>:9200/metrics?target=<host>:<port>&password=<yourrconpassword> You can use this URL for debugging purposes ;)

TODO

  • make example config for Prometheus
  • investigate aiorcon not timing out properly
  • make ip and port configurable
  • add a systemd unit file

Docker Support

The Dockerfile was added by [https://github.com/xvzf]. Thanks for that. I am not using docker, I can not give you support on that.

More information

I wrote a blog post about this exporter. You can find it here

About

an prometheus exporter for SRCDS based gameservers (like CSGO, TF2, L4D2, ...).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.2%
  • Dockerfile 4.8%