Pterodactyl Exporter
Please use the Discussion for Support rather than the Issues.
A python script that exports performance metrics from Pterodactyl Panel 1.x via the Client API, converts the data to the correct format and provides a prometheus target.
This can be used for time series monitoring of Pterodactyl game servers and visualization with Grafana.
Feel free to try this script and submit an issue if needed.
How to install
What you need:
- Linux server (should run on Windows as well, but is only tested in a linux environment)
- Prometheus
- Python (3.10)
- Pterodactyl client API key
- Service account with read only is recommended
- You only need to set
Backup->Readas permission for the account to the server you want to monitor.
Run as Pterodactyl Server
- Download the Egg JSON from
egg/egg-pterodactyl-exporter.jsonor the releases - Import the Egg into the Nest of your choice
- Create the server from the egg and fill in the required config values
- Run the server
Run as service
Installed as user "prometheus":
- To install with pipx:
pipx install pterodactyl-exporter
- To install with pip (not recommended, could break system dependencies):
pip install pterodactyl-exporter
-
Create directory
pterodactyl_exporter. -
Create the config file
config.ymlin that directory (set the values as needed, it's recommended to use https):
host: panel.example.com
host_port: # This is the port of the panel (optional)
port: 9531 #Standard port for the exporter
api_key: APIKEY_APIKEYAPIKEYAPIKEY
https: true
ignore_ssl: false
server_list_type: owner
query_interval: 10 # Interval in seconds between each query to the Pterodactyl panel (default: 10)
- Create systemd service
/etc/systemd/system/pterodactyl_exporter.service:
[Unit]
Description=Prometheus Server
After=network-online.target
[Service]
User=prometheus
Restart=on-failure
ExecStart=pterodactyl_exporter \
--config-file=/home/prometheus/pterodactyl_exporter/config.yml
[Install]
WantedBy=multi-user.target
-
Enable and start the service.
-
Add a job configuration:
- job_name: 'pterodactyl_exporter'
static_configs:
- targets: ['localhost:9531']
- To get the Grafana dashboard, import id
16575. Alternatively download the JSON file from the releases.
To show and hide servers from being monitored, just remove the read permission of the service account on that Server
Run with Docker
-
Create a folder named
pterodactyl_exporter -
Download the config file from GitHub:
curl -fsSL -o config.yml https://raw.githubusercontent.com/LOENS2/pterodactyl_exporter/master/config.example.yml
-
Create a folder named
docker -
Download the
docker-compose.ymlinto that folder:
curl -fsSL -o docker-compose.yml https://raw.githubusercontent.com/LOENS2/pterodactyl_exporter/master/docker/docker-compose.yml
- Run the container:
docker-compose up -d
Run manually
Only meant for testing purposes, not recommended for production use!
- Clone the project:
git clone https://github.com/LOENS2/pterodactyl_exporter.git
- Change to the cloned directory
cd pterodactyl_exporter
- Install dependencies:
python -m pip install -r requirements.txt
- Run with python:
python -m pterodactyl_exporter.pterodactyl_exporter --config-file=config.example.yml
Troubleshooting
You can view the output with (Time is UTC):
sudo journalctl -u pterodacyl_exporter.service -b --since "2024-12-14 13:45:27"
Post any stacktraces as an Issue.
With special thanks to @grimsi for helping me with docker.
© LOENS2 2023
Metadata
Release files for pterodactyl-exporter 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pterodactyl_exporter-1.0.7.tar.gz | 27.8 kB | Without provenance | Details for pterodactyl_exporter-1.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pterodactyl_exporter-1.0.7-py3-none-any.whl | Python 3 | none | any | Details for pterodactyl_exporter-1.0.7-py3-none-any.whl |
Total release size: 53.6 kB
Release files / pterodactyl_exporter-1.0.7.tar.gz
| Download URL | pterodactyl_exporter-1.0.7.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54cd9644892206745eb436c855562fc8c7a194ce9a63516b5e3e5a8f451fa189
|
|
BLAKE2b-256 checksum How to use checksums |
db5ae462804379ee6e16f9d8d6958aff00d7d5f4bb3a96d74eeceb0b19862f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pterodactyl_exporter-1.0.7-py3-none-any.whl
| Download URL | pterodactyl_exporter-1.0.7-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
410f3a589ca96e609fe7b8794531d09d245838b71ce21f871d633a41c3bf89d5
|
|
BLAKE2b-256 checksum How to use checksums |
8737a492426ff95b3061c11cb4852090e67b91c4ad8b8596cf4c60ed4930a25b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for pterodactyl-exporter 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.