{"id":13735659,"url":"https://github.com/991jo/srcds_exporter","last_synced_at":"2025-05-08T12:30:47.504Z","repository":{"id":53663385,"uuid":"163870234","full_name":"991jo/srcds_exporter","owner":"991jo","description":"an prometheus exporter for SRCDS based gameservers (like CSGO, TF2, L4D2, ...).","archived":false,"fork":false,"pushed_at":"2021-03-20T00:22:40.000Z","size":35,"stargazers_count":17,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T04:30:53.016Z","etag":null,"topics":["csgo","css","fof","game-server","gmod","hl2dm","l4d2","monitoring","prometheus-exporter","srcds","srcds-exporter","teamfortress2","tf2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/991jo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-02T17:27:48.000Z","updated_at":"2024-04-27T22:29:51.000Z","dependencies_parsed_at":"2022-09-14T08:41:48.857Z","dependency_job_id":null,"html_url":"https://github.com/991jo/srcds_exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/991jo%2Fsrcds_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/991jo%2Fsrcds_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/991jo%2Fsrcds_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/991jo%2Fsrcds_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/991jo","download_url":"https://codeload.github.com/991jo/srcds_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253068350,"owners_count":21848793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csgo","css","fof","game-server","gmod","hl2dm","l4d2","monitoring","prometheus-exporter","srcds","srcds-exporter","teamfortress2","tf2"],"created_at":"2024-08-03T03:01:09.454Z","updated_at":"2025-05-08T12:30:47.196Z","avatar_url":"https://github.com/991jo.png","language":"Python","funding_links":[],"categories":["Software"],"sub_categories":["Gameserver Management"],"readme":"# Prometheus SRCDS Exporter\n\nThis is an exporter for the Prometheus monitoring system.\nIt exports data from SRCDS Gameservers (e.g. CSGO, TF2, L4D2, ...) via rcon.\nIt uses the `status` and `stats` commands for this.\n\n## Supported Servers:\n\n- CSGO\n- CSS\n- L4D2\n- FoF\n- HL2DM\n- TF2\n- Gmod\n\n## How to install:\n\n1. `git clone https://github.com/991jo/srcds_exporter.git`\n2. `cd srcds_exporter`\n3. `python3 -m venv .`\n4. `source bin/activate`\n4. `pip install -r requirements.txt`\n5. `python3 main.py`\n\n## Multi-Server vs. Single Server Mode\n\nInitially this software was build as an exporter which can query many servers.\nThis conflicts a bit with the Prometheus Exporter mentality that you should\nrun one exporter per instance of your application.\nAlso you would have to know the RCON password which would get passed around\nin HTTP requests.\nTherefore SRCDS Exporter now supports the single server mode.\nIn this mode you have to specify the ip, port and password as a start\nparameter. But your HTTP requests dont need those parameters anymore.\nAlso the exporter does not answer requests which have those fields set.\n\n## How to query via Prometheus:\n\n### Multi-Server-Mode\n\nYou can use the following example config.\nPlease adjust the IP:port in the last row to the IP:port your exporter uses.\n```\n  - job_name: srcds\n\n    scrape_interval: 5s\n\n    metrics_path: /metrics\n\n    static_configs:\n          - targets: [\"\u003cip\u003e:\u003cport\u003e:\u003crconpassword\u003e\"]\n\n    relabel_configs:\n        - source_labels: [__address__]\n          regex: \"(.+:.+):.+\"\n          replacement: \"$1\"\n          target_label: __param_target\n        - source_labels: [__address__]\n          regex: \".+:.+:(.+)\"\n          replacement: \"$1\"\n          target_label: __param_password\n        - source_labels: [__param_target]\n          target_label: instance\n        - target_label: __address__\n          replacement: 127.0.0.1:9591 # The real ip/port of the srcds_exporter\n```\n\nBasically you have to build this URL:\n`http://\u003cexporter-address\u003e:9591/metrics?target=\u003chost\u003e:\u003cport\u003e\u0026password=\u003cyourrconpassword\u003e`\nYou can use this URL for debugging purposes ;)\n\n### Single-Server-Mode\n\nFor the single server mode you have to specify the parameters on the commandline.\n\n    python3 main.py --server_address \u003cserver address\u003e --server_port \u003cport\u003e --password \u003crcon password\u003e\n\nYour Prometheus config could look like this:\n\n```\n  - job_name: srcds\n\n    scrape_interval: 5s\n\n    metrics_path: /metrics\n\n    static_configs:\n          - targets: [\"\u003cip\u003e:\u003cport\u003e\"]\n```\n\n## Known issues\n\nSome servers do not respond to RCON while changing maps.\nThis results in timeouts and connection errors for the exporter.\nThis means that you won't get data while the server changes the map.\nThis is okay because many of the metrics are irrelevant during map change anyway\n(e.g. the server FPS rate).\n\n## Getting Help\n\nFor a list of the commandline arguments start the exporter with the `--help`\nflag.\nIf you have other problems, feel free to open an issue.\n\n## TODO\n\n- [x] make example config for Prometheus\n- [ ] investigate aiorcon not timing out properly\n- [x] make ip and port configurable\n- [ ] add a systemd unit file\n\n## Docker Support\n\nThe Dockerfile was added by [https://github.com/xvzf]. Thanks for that.\nI am not using docker, I can not give you support on that.\n\n## More information\n\nI wrote a blog post about this exporter. You can find it [here](http://swagspace.org/posts/srcds-exporter.html)\n\n## Further information regarding var, varms and sv\n\n(https://www.reddit.com/r/GlobalOffensive/comments/23zt18/explanation_of_the_new_net_graph_thanks_vitaliy/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F991jo%2Fsrcds_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F991jo%2Fsrcds_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F991jo%2Fsrcds_exporter/lists"}