Compare commits

...

49 Commits

Author SHA1 Message Date
0ee1e3fe64 Add docker build action for arm64
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 17m1s
2025-08-26 22:10:05 -07:00
338125e026 Update README
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 3m3s
2025-08-26 16:15:11 -07:00
d6f8d9b73f Update docker-compose sample
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m12s
2025-08-13 18:10:36 -07:00
1bdf20b6b1 Update docker-compose sample
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m6s
2025-08-13 03:08:34 -07:00
8404eb990d Update README docker-compose sample
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m9s
2025-08-13 01:47:01 -07:00
25910652f4 Test commit
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m10s
2025-08-13 00:27:44 -07:00
de35154bc4 Modify container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m8s
2025-08-13 00:00:30 -07:00
1ce3f0d198 Modify container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m12s
2025-08-12 23:48:42 -07:00
2257ae1013 Update container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m12s
2025-08-12 15:21:20 -07:00
ce8809c7b0 Test push
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m11s
2025-08-12 15:04:20 -07:00
6a17690742 Fix container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m17s
2025-08-12 04:14:52 -07:00
52ccca7161 Update system signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m9s
2025-08-12 03:52:40 -07:00
c1ef92e832 Modify container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m11s
2025-08-12 02:58:05 -07:00
227fdca580 Add Docker process manager
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m11s
2025-08-12 02:36:08 -07:00
842247f8e4 Add signal handling to container
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m6s
2025-08-12 02:27:04 -07:00
3537fe2f4e Update CI/CD flow
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m6s
2025-08-11 05:24:57 -07:00
7fed3def78 Adjust embed directory
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m5s
2025-08-11 05:06:53 -07:00
dc75824b48 Update image build process
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m14s
2025-08-11 04:19:49 -07:00
02c2d75020 Update image build process
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m12s
2025-08-11 04:13:18 -07:00
a28e2d49fd Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 1m21s
2025-08-11 04:10:29 -07:00
e02144e490 Update image build process
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m5s
2025-08-11 03:54:21 -07:00
bae6e36478 Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 47s
2025-08-11 03:49:57 -07:00
06bd0cd90a Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 47s
2025-08-11 03:44:13 -07:00
ca2ab10ba5 Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 51s
2025-08-11 03:36:42 -07:00
cc5050aee2 Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 47s
2025-08-11 03:25:14 -07:00
30ddcd3a58 Update image build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 48s
2025-08-11 03:23:13 -07:00
47d4149e10 Update build process
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 51s
2025-08-11 03:19:41 -07:00
a336d9f97e Add Docker build workflow
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 3m27s
2025-08-11 03:13:37 -07:00
8dd38e7cde Update dependencies 2025-08-10 11:20:59 -07:00
f57f67191c Improve directory architecture 2025-08-10 10:53:25 -07:00
3a15c43d1b Platform agnostic logging 2025-08-10 10:02:22 -07:00
931719e53a Update container permissions 2025-08-10 09:37:26 -07:00
005d7de2a3 Update container permissions 2025-08-10 08:53:24 -07:00
c553c6877e Update container permissions 2025-08-10 08:39:32 -07:00
13e1a983d9 Simplify logger setup 2025-08-10 07:41:41 -07:00
0a5dcc6701 Update dockerfile 2025-08-10 06:52:54 -07:00
5b393de135 Add dynamic log directory 2025-08-10 06:31:17 -07:00
177febba63 Update README 2025-07-21 23:53:32 -07:00
d1138654a9 Expand README documentation 2025-07-21 23:29:47 -07:00
fe64046fc8 Expand README documentation 2025-07-21 23:26:58 -07:00
c1570acc40 Update README 2025-07-21 22:49:20 -07:00
5053520bd0 Disable config gen by default 2025-07-20 01:17:49 -07:00
8dc79551d6 Update README 2025-07-20 00:58:41 -07:00
88de5b1d99 Create README 2025-07-20 00:56:11 -07:00
aac9c2c535 Connfig gen for container 2025-07-20 00:15:18 -07:00
5f60e55e93 Optimized API update logic 2025-07-19 23:30:27 -07:00
e8712a4a3d Add sample config file 2025-07-19 21:26:06 -07:00
547980463e Merge remote-tracking branch 'origin/main' 2025-07-17 05:43:02 -07:00
e74c00a149 Gen config from env 2025-07-17 05:39:56 -07:00
11 changed files with 1193 additions and 61 deletions

View File

@@ -0,0 +1,36 @@
name: Docker Build and Push (Multi-architecture)
on: [push]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push multi-arch image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ vars.REGISTRY }}/${{ vars.IMAGE_NAME }}:latest

12
.gitignore vendored
View File

@@ -174,7 +174,11 @@ cython_debug/
# PyPI configuration file
.pypirc
# Other files
config.ini
*.log
*.log.*
# Logs
/logs
# Embeds
/embed
# Config file
config.ini

326
README.md
View File

@@ -1,2 +1,326 @@
# pterodactyl-discord-bot
# Pterodactyl Discord Bot
![Pterodactyl Logo](https://cdn.pterodactyl.io/logos/new/pterodactyl_logo_transparent.png)
A feature-rich Discord bot for monitoring and managing Pterodactyl game servers through Discord, providing real-time status monitoring and control capabilities with an intuitive interface.
## Table of Contents
- [Features](#features)
- [Architecture Overview](#architecture-overview)
- [Installation](#installation)
- [Traditional Installation](#traditional-installation)
- [Docker Installation](#docker-installation)
- [Configuration](#configuration)
- [Environment Variables](#environment-variables)
- [Configuration File](#configuration-file)
- [Usage](#usage)
- [First Run Setup](#first-run-setup)
- [Bot Commands](#bot-commands)
- [Embed System](#embed-system)
- [Permissions](#permissions)
- [Logging System](#logging-system)
- [Troubleshooting](#troubleshooting)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
## Features
### Core Functionality
- **Real-time Server Monitoring**: Auto-updating embeds showing server status (online/offline) and detailed resource usage
- **Power Management**: Start, stop, and restart servers directly from Discord with button controls
- **Connection Information**: One-click display of server addresses and ports
- **Multi-channel Support**: Status embeds can be placed in any channel with proper permissions
### Intelligent Updates
- **State Change Detection**: Embeds update immediately when server power state changes
- **Resource Thresholds**: CPU usage changes >50% trigger updates
- **Optimized API Calls**: Minimizes requests to the Discord API
### Access Control
- **Guild Restriction**: Operates only in specified Discord server
- **Role-based Permissions**: "Game Server User" role required for interactions
- **Admin Commands**: Special commands restricted to server administrators
### Reliability Features
- **Persistent Storage**: Remembers embed locations between bot restarts
- **Error Handling**: Comprehensive error recovery and logging
- **Rate Limit Protection**: Built-in delays between API calls
## Architecture Overview
The bot is built with several key components:
1. **PterodactylAPI Class**: Handles all communication with the Pterodactyl Panel API
2. **ServerStatusView Class**: Manages the interactive Discord UI with control buttons
3. **PterodactylBot Class**: Main bot class that orchestrates all operations
4. **Background Task**: Regularly checks server status and updates embeds when needed
5. **Configuration System**: Validates and manages all settings from config.ini
The system uses aiohttp for asynchronous HTTP requests and discord.py for Discord interactions.
## Installation
### Prerequisites
- Python 3.8 or higher **or** Docker
- Discord bot token with proper permissions
- Pterodactyl panel with API access
- Server with both Client and Application API keys
### Traditional Installation
1. Clone the repository:
```bash
git clone https://git.serendipity.systems/k.eaven/pterodactyl-discord-bot.git
cd pterodactyl-discord-bot
```
2. Install required dependencies:
```bash
pip install -r requirements.txt
```
3. Create and configure your `config.ini` file (see [Configuration](#configuration) section)
4. Run the bot:
```bash
python pterodisbot.py
```
### Docker Installation
1. Clone the repository:
```bash
git clone https://git.serendipity.systems/k.eaven/pterodactyl-discord-bot.git
cd pterodactyl-discord-bot
```
2. Build the Docker image:
```bash
docker build -t pterodisbot .
```
3. Create a directory for configuration:
```bash
mkdir -p bot-config
```
4. Create a `config.ini` file in the `bot-config` directory with your settings
5. Run the container with the config mounted:
```bash
docker run -d \
--name pterodisbot \
-v $(pwd)/bot-config:/app \
pterodisbot
```
6. For Docker Compose, create a `docker-compose.yml` file:
```yaml
services:
pterodisbot:
build: .
environment:
# Remmove brackets and spaces in environment variables
# Ideally, use .env file to assign values to these instead
- DISCORD_TOKEN={Your Discord bot token}
- ALLOWED_GUILD_ID={The Discord server ID where the bot should operate}
- PANEL_URL={Your Pterodactyl panel URL (must include http:// or https://)}
- CLIENT_API_KEY={Pterodactyl client API key (starts with `ptlc_`)}
- APPLICATION_API_KEY={Pterodactyl application API key (starts with `ptla_`)}
volumes:
- bot_logs:/app/logs
- bot_embed:/app/embed
restart: unless-stopped
volumes:
bot_logs:
bot_embed:
```
Then run:
```bash
docker-compose up -d
```
## Configuration
### Environment Variables
When using Docker or generating the config automatically, these environment variables are required:
- `DISCORD_TOKEN`: Your Discord bot token
- `ALLOWED_GUILD_ID`: The Discord server ID where the bot should operate
- `PANEL_URL`: Your Pterodactyl panel URL (must include http:// or https://)
- `CLIENT_API_KEY`: Pterodactyl client API key (starts with `ptlc_`)
- `APPLICATION_API_KEY`: Pterodactyl application API key (starts with `ptla_`)
### Configuration File
The bot uses a `config.ini` file with this structure:
```ini
[Pterodactyl]
PanelURL = https://your.pterodactyl.panel
ClientAPIKey = ptlc_yourclientkey
ApplicationAPIKey = ptla_yourapplicationkey
[Discord]
Token = your.discord.bot.token
AllowedGuildID = 123456789012345678
```
To generate the config file from environment variables:
```bash
python generate_config.py
```
## Usage
### First Run Setup
1. Invite your bot to your Discord server with these permissions:
- View Channels
- Send Messages
- Embed Links
- Manage Messages (for embed updates)
- Use Slash Commands
2. Create a "Game Server User" role for users who should control servers
3. Use the `/server_status` command to create your first status embed
### Bot Commands
#### `/server_status [server_name] [channel]`
Display a server's status embed in the specified channel (or current channel if not specified).
**Example:**
```
/server_status server_name: "Minecraft Survival" channel: #game-servers
```
#### `/refresh_embeds` (Admin only)
Force a refresh of all server status embeds. This is useful if embeds become out of sync.
### Embed System
Status embeds include:
- Server name and current state (color-coded)
- Resource usage (when online):
- CPU percentage
- Memory usage
- Disk usage
- Network activity
- Interactive buttons:
- Start (green)
- Stop (red)
- Restart (blue)
- Show Address (grey)
Embed locations are stored in `embed_locations.json` and persist between bot restarts.
## Permissions
The bot implements two levels of access control:
1. **Guild Restriction**: Only works in the Discord server specified in `AllowedGuildID`
2. **Role Requirement**: Users must have the "Game Server User" role to interact with server controls
Administrators can use the `/refresh_embeds` command.
## Logging System
The bot maintains comprehensive logs in two locations:
1. **File Logs**: Rotating log files (5MB max, 3 backups) in `pterodactyl_bot.log`
2. **Console Output**: Real-time logging to stdout
Log levels:
- **DEBUG**: Detailed operational information (API calls, state changes)
- **INFO**: General operational messages (bot startup, command usage)
- **WARNING**: Potential issues (missing embeds, API warnings)
- **ERROR**: Operational failures (API errors, permission issues)
- **CRITICAL**: Critical failures (configuration errors, startup failures)
## Troubleshooting
### Common Issues
**Embeds not updating:**
- Verify the bot has proper channel permissions
- Check API keys have correct permissions
- Use `/refresh_embeds` to reset all embeds
**Buttons not working:**
- Confirm users have the "Game Server User" role
- Ensure the bot has these permissions:
- View Channel
- Send Messages
- Embed Links
- Use Slash Commands
**API errors:**
- Double-check your Pterodactyl panel URL
- Verify API keys are correct and not expired
- Confirm the server exists in Pterodactyl
### Checking Logs
For real-time log monitoring:
```bash
tail -f pterodactyl_bot.log
```
## Development
### Requirements
- Python 3.8+
- Poetry (recommended) or pip
### Setup
1. Clone the repository
2. Install dependencies:
```bash
poetry install
```
or
```bash
pip install -r requirements.txt -r requirements-dev.txt
```
3. Create a `.env` file with your development environment variables
4. Run in development mode:
```bash
python pterodisbot.py
```
### Testing
The project includes unit tests (to be expanded). Run with:
```bash
pytest
```
## Contributing
Contributions are welcome! Please follow these guidelines:
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/your-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin feature/your-feature`)
5. Open a pull request
### Coding Standards
- Follow PEP 8 style guidelines
- Include type hints for all function signatures
- Document public methods with docstrings
- Write tests for new functionality
## License
This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
---
**Note**: This bot is designed for single Pterodactyl domain and single Discord guild use. For multi-instance support, significant modifications would be required.

8
config.ini.sample Normal file
View File

@@ -0,0 +1,8 @@
[Pterodactyl]
PanelURL = https://your.pterodactyl.url
ClientAPIKey = ptlc_yourpterodactylclientapikey
ApplicationAPIKey = ptla_yourpterodactylapplicationapikey
[Discord]
Token = yourdiscordbottoken
AllowedGuildID = yourdiscordguildid

View File

@@ -10,22 +10,37 @@ RUN apt-get update && apt-get install -y \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install tini for better signal handling in container
RUN apt-get update && apt-get install -y tini
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create a non-root user
RUN groupadd -r bot && useradd -r -g bot bot
# Create a non-root user and switch to it
RUN useradd -m botuser && chown -R botuser:botuser /app
USER botuser
# Copy the rest of the application
COPY --chown=bot:bot . .
# Create directories for persistent storage and modify permissions
RUN chown -R bot:bot /app && \
chmod -R 777 /app
RUN mkdir -p logs && \
chown -R bot:bot logs && \
chmod -R 777 logs && \
mkdir -p embed && \
chown -R bot:bot embed && \
chmod -R 777 embed
# Switch to non root user
USER bot
# Set environment variables for configuration
ENV PYTHONUNBUFFERED=1
ENV CONFIG_PATH=/app/config.ini
# Command to run the bot
CMD ["python", "pterodisbot.py"]
# Run the bot using tini and entrypoint script
ENTRYPOINT ["tini", "--", "/bin/sh", "entrypoint.sh"]

View File

@@ -1,10 +0,0 @@
{
"401095ca": {
"channel_id": "1392730642206429307",
"message_id": "1395282129377689671"
},
"548c4f18": {
"channel_id": "1392730682576343121",
"message_id": "1395282135237001358"
}
}

8
entrypoint.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
if ! python generate_config.py; then
echo "Failed to generate config"
exit 1
fi
exec python pterodisbot.py

View File

@@ -1,6 +1,7 @@
import os
import configparser
from pathlib import Path
from dotenv import load_dotenv
def validate_env_vars():
"""Validate that required environment variables are set and non-empty."""
@@ -45,4 +46,5 @@ def generate_config():
print(f"Config file generated at {config_path}")
if __name__ == "__main__":
load_dotenv()
generate_config()

629
pterodisbot.log.sample Normal file
View File

@@ -0,0 +1,629 @@
2025-07-19 23:23:41,814 - INFO - Initialized logging system with file and console output
2025-07-19 23:23:41,814 - INFO - Configuration validation passed
2025-07-19 23:23:41,815 - DEBUG - Loaded and validated configuration values from config.ini
2025-07-19 23:23:41,816 - INFO - Initialized PterodactylBot instance with state tracking
2025-07-19 23:23:41,817 - INFO - Starting bot initialization
2025-07-19 23:23:42,336 - INFO - Running bot setup hook
2025-07-19 23:23:42,337 - INFO - Initialized PterodactylAPI client with provided credentials
2025-07-19 23:23:42,337 - DEBUG - Created new aiohttp ClientSession
2025-07-19 23:23:42,337 - INFO - Initialized Pterodactyl API client
2025-07-19 23:23:42,338 - DEBUG - Attempting to load embed locations from storage
2025-07-19 23:23:42,338 - INFO - Loaded 2 embed locations from storage
2025-07-19 23:23:42,338 - INFO - Started background status update task
2025-07-19 23:23:42,339 - DEBUG - Waiting for bot readiness before starting update task
2025-07-19 23:23:44,729 - INFO - Starting full refresh of all server embeds
2025-07-19 23:23:44,730 - INFO - Bot connected as Serendipity Systems PteroAPI (ID: 1392436613354754068)
2025-07-19 23:23:44,931 - INFO - Successfully synced 2 command(s) to guild 1391752412947288155: ['server_status', 'refresh_embeds']
2025-07-19 23:23:45,732 - DEBUG - Server cache empty, fetching fresh server list
2025-07-19 23:23:45,732 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:23:45,732 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:23:45,733 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:23:46,064 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:23:46,065 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:23:46,066 - INFO - Populated server cache with 19 servers
2025-07-19 23:23:46,066 - DEBUG - Creating new embed for server 401095ca
2025-07-19 23:23:46,067 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:23:46,067 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:23:46,067 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:23:46,361 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:23:46,361 - DEBUG - Server 401095ca current state: running
2025-07-19 23:23:46,361 - DEBUG - Building status embed for server Vintage Story (401095ca)
2025-07-19 23:23:46,362 - DEBUG - Created ServerStatusView for Vintage Story (401095ca)
2025-07-19 23:23:46,362 - DEBUG - Successfully built status components for Vintage Story
2025-07-19 23:23:46,605 - INFO - Created new embed for server Vintage Story
2025-07-19 23:23:47,606 - DEBUG - Creating new embed for server 548c4f18
2025-07-19 23:23:47,607 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:23:47,607 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:23:47,607 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:23:47,893 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:23:47,894 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:23:47,894 - DEBUG - Building status embed for server Cobblemon (548c4f18)
2025-07-19 23:23:47,894 - DEBUG - Created ServerStatusView for Cobblemon (548c4f18)
2025-07-19 23:23:47,894 - DEBUG - Successfully built status components for Cobblemon
2025-07-19 23:23:48,080 - INFO - Created new embed for server Cobblemon
2025-07-19 23:23:49,082 - INFO - Created 2 new embeds, skipped 17 servers
2025-07-19 23:23:49,531 - DEBUG - Deleted old embed for server 401095ca
2025-07-19 23:23:50,544 - DEBUG - Deleted old embed for server 548c4f18
2025-07-19 23:23:51,045 - INFO - Deleted 2 old embeds, 0 already missing
2025-07-19 23:23:51,046 - DEBUG - Attempting to save embed locations to storage
2025-07-19 23:23:51,047 - DEBUG - Successfully saved embed locations to disk
2025-07-19 23:23:51,047 - INFO - Starting optimized server status update cycle
2025-07-19 23:23:51,048 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:23:51,048 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:23:51,049 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:23:51,298 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:23:51,298 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:23:51,299 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:23:51,299 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:23:51,300 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:23:51,300 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:23:51,300 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:23:51,465 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:23:51,466 - DEBUG - Server 401095ca current state: running
2025-07-19 23:23:51,466 - DEBUG - Power state changed for Vintage Story: None -> running
2025-07-19 23:23:51,467 - DEBUG - Building status embed for server Vintage Story (401095ca)
2025-07-19 23:23:51,467 - DEBUG - Created ServerStatusView for Vintage Story (401095ca)
2025-07-19 23:23:51,468 - DEBUG - Successfully built status components for Vintage Story
2025-07-19 23:23:53,300 - DEBUG - Updated status for Vintage Story
2025-07-19 23:23:53,801 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:23:53,802 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:23:53,802 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:23:53,802 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:23:53,983 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:23:53,983 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:23:53,984 - DEBUG - Power state changed for Cobblemon: None -> offline
2025-07-19 23:23:53,984 - DEBUG - Building status embed for server Cobblemon (548c4f18)
2025-07-19 23:23:53,984 - DEBUG - Created ServerStatusView for Cobblemon (548c4f18)
2025-07-19 23:23:53,984 - DEBUG - Successfully built status components for Cobblemon
2025-07-19 23:23:54,440 - DEBUG - Updated status for Cobblemon
2025-07-19 23:23:54,941 - INFO - Update cycle complete: 2 updated, 0 skipped, 0 missing, 0 errors
2025-07-19 23:24:01,051 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:01,051 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:01,052 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:01,052 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:01,265 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:01,266 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:01,267 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:01,267 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:01,267 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:01,268 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:01,268 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:01,451 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:01,451 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:01,452 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:01,953 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:01,954 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:01,954 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:01,955 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:02,131 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:02,131 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:02,131 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:02,632 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:24:11,057 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:11,058 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:11,059 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:11,060 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:11,283 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:11,284 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:11,284 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:11,285 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:11,285 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:11,285 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:11,286 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:11,569 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:11,570 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:11,571 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:12,072 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:12,072 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:12,072 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:12,072 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:12,312 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:12,313 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:12,313 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:12,814 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:24:21,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:21,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:21,054 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:21,054 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:21,272 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:21,272 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:21,273 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:21,274 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:21,274 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:21,274 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:21,275 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:21,442 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:21,443 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:21,443 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:21,944 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:21,945 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:21,945 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:21,945 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:22,120 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:22,120 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:22,120 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:22,621 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:24:31,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:31,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:31,054 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:31,054 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:31,280 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:31,281 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:31,281 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:31,282 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:31,282 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:31,283 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:31,283 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:31,453 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:31,453 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:31,454 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:31,955 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:31,956 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:31,956 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:31,956 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:32,127 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:32,128 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:32,128 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:32,629 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:24:41,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:41,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:41,054 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:41,054 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:41,277 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:41,278 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:41,278 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:41,279 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:41,279 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:41,280 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:41,280 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:41,532 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:41,533 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:41,533 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:42,034 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:42,035 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:42,035 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:42,035 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:42,300 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:42,301 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:42,301 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:42,802 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:24:51,048 - INFO - Starting optimized server status update cycle
2025-07-19 23:24:51,049 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:24:51,050 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:24:51,050 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:24:51,290 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:24:51,290 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:24:51,291 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:24:51,291 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:24:51,291 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:24:51,291 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:24:51,291 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:24:51,457 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:24:51,458 - DEBUG - Server 401095ca current state: running
2025-07-19 23:24:51,458 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:24:51,959 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:24:51,960 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:24:51,960 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:24:51,960 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:24:52,131 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:24:52,132 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:24:52,132 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:24:52,633 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:01,056 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:01,058 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:01,058 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:01,058 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:01,303 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:01,303 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:01,305 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:01,306 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:01,306 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:01,306 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:01,306 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:01,493 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:01,494 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:01,494 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:01,996 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:01,996 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:01,996 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:01,996 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:02,170 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:02,170 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:02,170 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:02,672 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:11,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:11,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:11,053 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:11,053 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:11,277 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:11,278 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:11,279 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:11,279 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:11,279 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:11,280 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:11,280 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:11,531 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:11,531 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:11,531 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:12,032 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:12,033 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:12,033 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:12,033 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:12,305 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:12,305 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:12,306 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:12,806 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:21,054 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:21,055 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:21,055 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:21,055 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:21,282 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:21,282 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:21,282 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:21,283 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:21,283 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:21,284 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:21,284 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:21,450 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:21,450 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:21,451 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:21,952 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:21,952 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:21,952 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:21,952 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:22,119 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:22,120 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:22,120 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:22,621 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:31,055 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:31,056 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:31,057 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:31,057 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:31,278 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:31,279 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:31,280 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:31,280 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:31,280 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:31,281 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:31,281 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:31,448 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:31,449 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:31,450 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:31,951 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:31,951 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:31,951 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:31,951 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:32,122 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:32,122 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:32,122 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:32,624 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:41,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:41,052 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:41,053 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:41,053 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:41,278 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:41,278 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:41,279 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:41,279 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:41,279 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:41,280 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:41,280 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:41,525 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:41,526 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:41,526 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:42,027 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:42,028 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:42,028 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:42,029 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:42,279 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:42,280 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:42,280 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:42,781 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:25:51,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:25:51,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:25:51,054 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:25:51,054 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:25:51,296 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:25:51,296 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:25:51,297 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:25:51,297 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:25:51,297 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:25:51,297 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:25:51,297 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:25:51,461 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:25:51,462 - DEBUG - Server 401095ca current state: running
2025-07-19 23:25:51,462 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:25:51,963 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:25:51,963 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:25:51,964 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:25:51,964 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:25:52,132 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:25:52,132 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:25:52,133 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:25:52,634 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:01,056 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:01,057 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:01,057 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:01,057 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:01,277 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:01,278 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:01,279 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:01,279 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:01,280 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:01,280 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:01,281 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:01,444 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:01,445 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:01,446 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:01,947 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:01,947 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:01,947 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:01,947 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:02,123 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:02,124 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:02,124 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:02,626 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:11,048 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:11,049 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:11,049 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:11,049 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:11,291 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:11,291 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:11,292 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:11,292 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:11,292 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:11,293 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:11,293 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:11,532 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:11,533 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:11,533 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:12,033 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:12,034 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:12,034 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:12,034 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:12,289 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:12,289 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:12,289 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:12,790 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:21,053 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:21,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:21,054 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:21,054 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:21,289 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:21,289 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:21,290 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:21,290 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:21,290 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:21,290 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:21,290 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:21,456 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:21,456 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:21,456 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:21,957 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:21,958 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:21,958 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:21,958 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:22,127 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:22,127 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:22,127 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:22,628 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:31,048 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:31,049 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:31,050 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:31,050 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:31,291 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:31,291 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:31,292 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:31,292 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:31,292 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:31,292 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:31,292 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:31,457 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:31,458 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:31,458 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:31,959 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:31,959 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:31,959 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:31,960 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:32,123 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:32,123 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:32,123 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:32,624 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:41,056 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:41,057 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:41,058 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:41,058 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:41,313 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:41,313 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:41,314 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:41,314 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:41,314 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:41,315 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:41,315 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:41,569 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:41,570 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:41,570 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:42,072 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:42,072 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:42,073 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:42,073 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:42,310 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:42,311 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:42,311 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:42,812 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:26:51,052 - INFO - Starting optimized server status update cycle
2025-07-19 23:26:51,053 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:26:51,053 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:26:51,053 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:26:51,266 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:26:51,266 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:26:51,267 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:26:51,267 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:26:51,268 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:26:51,268 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:26:51,268 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:26:51,440 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:26:51,440 - DEBUG - Server 401095ca current state: running
2025-07-19 23:26:51,441 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:26:51,942 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:26:51,942 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:26:51,942 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:26:51,942 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:26:52,113 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:26:52,113 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:26:52,113 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:26:52,614 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:01,048 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:01,049 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:01,049 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:01,049 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:01,261 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:01,262 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:01,263 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:01,264 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:01,264 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:01,265 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:01,265 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:01,440 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:01,441 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:01,442 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:01,943 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:01,943 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:01,944 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:01,944 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:02,112 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:02,113 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:02,113 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:02,614 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:11,051 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:11,052 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:11,052 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:11,053 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:11,274 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:11,274 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:11,275 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:11,275 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:11,275 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:11,275 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:11,275 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:11,524 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:11,524 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:11,524 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:12,025 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:12,025 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:12,026 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:12,026 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:12,266 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:12,267 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:12,267 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:12,768 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:21,055 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:21,056 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:21,056 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:21,057 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:21,282 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:21,282 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:21,283 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:21,283 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:21,283 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:21,284 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:21,284 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:21,456 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:21,457 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:21,457 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:21,958 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:21,958 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:21,958 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:21,959 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:22,137 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:22,138 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:22,138 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:22,639 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:31,048 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:31,049 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:31,050 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:31,050 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:31,283 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:31,284 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:31,285 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:31,285 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:31,285 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:31,285 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:31,285 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:31,476 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:31,476 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:31,476 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:31,977 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:31,978 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:31,978 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:31,978 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:32,157 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:32,157 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:32,157 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:32,658 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:41,057 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:41,058 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:41,059 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:41,059 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:41,293 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:41,294 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:41,294 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:41,294 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:41,294 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:41,295 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:41,295 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:41,532 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:41,532 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:41,533 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:42,034 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:42,034 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:42,034 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:42,034 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:42,277 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:42,277 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:42,277 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:42,778 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:27:51,049 - INFO - Starting optimized server status update cycle
2025-07-19 23:27:51,050 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:27:51,051 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:27:51,051 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:27:51,287 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:27:51,288 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:27:51,288 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:27:51,288 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:27:51,289 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:27:51,289 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:27:51,289 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:27:51,452 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:27:51,453 - DEBUG - Server 401095ca current state: running
2025-07-19 23:27:51,453 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:27:51,954 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:27:51,954 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:27:51,954 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:27:51,954 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:27:52,127 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:27:52,127 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:27:52,127 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:27:52,628 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors
2025-07-19 23:28:01,056 - INFO - Starting optimized server status update cycle
2025-07-19 23:28:01,057 - INFO - Fetching list of all servers from Pterodactyl panel
2025-07-19 23:28:01,058 - DEBUG - Preparing GET request to application/servers using Application API key
2025-07-19 23:28:01,058 - DEBUG - Acquired lock for API request to application/servers
2025-07-19 23:28:01,284 - DEBUG - Received response from application/servers with status 200
2025-07-19 23:28:01,284 - INFO - Retrieved 19 servers from Pterodactyl panel
2025-07-19 23:28:01,284 - DEBUG - Updated server cache with 19 servers
2025-07-19 23:28:01,284 - DEBUG - Checking status for server Vintage Story (401095ca)
2025-07-19 23:28:01,284 - DEBUG - Fetching resource usage for server 401095ca
2025-07-19 23:28:01,285 - DEBUG - Preparing GET request to client/servers/401095ca/resources using Client API key
2025-07-19 23:28:01,285 - DEBUG - Acquired lock for API request to client/servers/401095ca/resources
2025-07-19 23:28:01,450 - DEBUG - Received response from client/servers/401095ca/resources with status 200
2025-07-19 23:28:01,450 - DEBUG - Server 401095ca current state: running
2025-07-19 23:28:01,450 - DEBUG - No changes detected for Vintage Story, skipping update
2025-07-19 23:28:01,951 - DEBUG - Checking status for server Cobblemon (548c4f18)
2025-07-19 23:28:01,952 - DEBUG - Fetching resource usage for server 548c4f18
2025-07-19 23:28:01,952 - DEBUG - Preparing GET request to client/servers/548c4f18/resources using Client API key
2025-07-19 23:28:01,952 - DEBUG - Acquired lock for API request to client/servers/548c4f18/resources
2025-07-19 23:28:02,117 - DEBUG - Received response from client/servers/548c4f18/resources with status 200
2025-07-19 23:28:02,118 - DEBUG - Server 548c4f18 current state: offline
2025-07-19 23:28:02,118 - DEBUG - No changes detected for Cobblemon, skipping update
2025-07-19 23:28:02,619 - INFO - Update cycle complete: 0 updated, 2 skipped, 0 missing, 0 errors

View File

@@ -16,6 +16,10 @@ Features:
import discord
from discord.ext import commands, tasks
from discord import app_commands
import os
import sys
import signal
import types
import aiohttp
import asyncio
import json
@@ -32,14 +36,17 @@ import generate_config
# LOGGING SETUP
# ==============================================
logger = logging.getLogger('pterodactyl_bot')
logs_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs')
os.makedirs(logs_dir, exist_ok=True)
logger = logging.getLogger('pterodisbot')
logger.setLevel(logging.DEBUG)
# File handler for logs (rotates when reaching 5MB, keeps 3 backups)
handler = RotatingFileHandler(
'pterodactyl_bot.log',
maxBytes=5*1024*1024,
backupCount=3,
filename=os.path.join(logs_dir, 'pterodisbot.log'),
maxBytes=5*1024*1024, # 5 MiB max log file size
backupCount=3, # Rotate through 3 files
encoding='utf-8'
)
handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
@@ -138,8 +145,8 @@ try:
DISCORD_TOKEN = config.get('Discord', 'Token')
ALLOWED_GUILD_ID = config.getint('Discord', 'AllowedGuildID')
REQUIRED_ROLE = "Game Server User"
UPDATE_INTERVAL = 1
EMBED_LOCATIONS_FILE = "embed_locations.json"
UPDATE_INTERVAL = 10
EMBED_LOCATIONS_FILE = "./embed/embed_locations.json"
logger.debug("Loaded and validated configuration values from config.ini")
@@ -538,12 +545,15 @@ class PterodactylBot(commands.Bot):
Sets up caches, locks, and storage paths.
"""
super().__init__(*args, **kwargs)
self.pterodactyl_api = None # Will be initialized in setup_hook
self.server_cache: Dict[str, dict] = {} # Cache of server data
self.embed_locations: Dict[str, Dict[str, int]] = {} # Tracks embed positions
self.pterodactyl_api = None # Pterodactyl API client
self.server_cache: Dict[str, dict] = {} # Cache of server data from Pterodactyl
self.embed_locations: Dict[str, Dict[str, int]] = {} # Tracks where embeds are posted
self.update_lock = asyncio.Lock() # Prevents concurrent updates
self.embed_storage_path = Path(EMBED_LOCATIONS_FILE) # Storage file path
logger.info("Initialized PterodactylBot instance")
self.embed_storage_path = Path(EMBED_LOCATIONS_FILE) # File to store embed locations
# Track previous server states and CPU usage to detect changes
# Format: {server_id: (state, cpu_usage)}
self.previous_states: Dict[str, Tuple[str, float]] = {}
logger.info("Initialized PterodactylBot instance with state tracking")
async def setup_hook(self):
"""
@@ -773,28 +783,39 @@ class PterodactylBot(commands.Bot):
logger.debug(f"Successfully built status components for {name}")
return embed, view
@tasks.loop(minutes=UPDATE_INTERVAL)
@tasks.loop(seconds=UPDATE_INTERVAL)
async def update_status(self):
"""Background task to update all server status embeds periodically."""
logger.info("Starting scheduled server status update cycle")
async with self.update_lock:
"""
Background task to update server status embeds when:
1. Server power state changes (started/stopped/restarted)
2. Significant CPU usage change (>50% difference)
3. First time seeing the server
This minimizes API calls to Discord and updates while maintaining
real-time awareness of important server changes.
"""
logger.info("Starting optimized server status update cycle")
async with self.update_lock: # Ensure only one update runs at a time
try:
# Get current server list
# Fetch current server list from Pterodactyl
servers = await self.pterodactyl_api.get_servers()
if not servers:
logger.warning("No servers found in Pterodactyl panel during update")
return
# Update cache
# Update our local cache with fresh server data
self.server_cache = {server['attributes']['identifier']: server for server in servers}
logger.debug(f"Updated server cache with {len(servers)} servers")
# Update each server's embed
update_count = 0
error_count = 0
missing_count = 0
# Variables to track our update statistics
update_count = 0 # Successful updates
error_count = 0 # Failed updates
missing_count = 0 # Missing embeds
skipped_count = 0 # Servers that didn't need updates
# Process each server we're tracking embeds for
for server_id, location in list(self.embed_locations.items()):
# Skip if server no longer exists in Pterodactyl
if server_id not in self.server_cache:
logger.warning(f"Server {server_id} not found in cache, skipping update")
continue
@@ -803,38 +824,84 @@ class PterodactylBot(commands.Bot):
server_name = server_data['attributes']['name']
try:
logger.debug(f"Updating status for server {server_name} ({server_id})")
logger.debug(f"Checking status for server {server_name} ({server_id})")
# Get current server resource usage
resources = await self.pterodactyl_api.get_server_resources(server_id)
embed, view = await self.get_server_status_embed(server_data, resources)
channel = self.get_channel(int(location['channel_id']))
if not channel:
logger.warning(f"Channel {location['channel_id']} not found for server {server_id}")
continue
current_state = resources.get('attributes', {}).get('current_state', 'offline')
cpu_usage = round(resources.get('attributes', {}).get('resources', {}).get('cpu_absolute', 0), 2)
# Retrieve previous recorded state and CPU usage
prev_state, prev_cpu = self.previous_states.get(server_id, (None, 0))
# DECISION LOGIC: Should we update the embed?
needs_update = False
# 1. Check if power state changed (most important)
if current_state != prev_state:
logger.debug(f"Power state changed for {server_name}: {prev_state} -> {current_state}")
needs_update = True
# 2. Check for significant CPU change (only if server is running)
elif current_state == 'running' and abs(cpu_usage - prev_cpu) > 50:
logger.debug(f"Significant CPU change for {server_name}: {prev_cpu}% -> {cpu_usage}%")
needs_update = True
# 3. First time we're seeing this server (initial update)
elif prev_state is None:
logger.debug(f"First check for {server_name}, performing initial update")
needs_update = True
# PERFORM UPDATE IF NEEDED
if needs_update:
# Generate fresh embed and view components
embed, view = await self.get_server_status_embed(server_data, resources)
message = await channel.fetch_message(int(location['message_id']))
await message.edit(embed=embed, view=view)
update_count += 1
logger.debug(f"Successfully updated status for {server_name}")
# Get the channel where this server's embed lives
channel = self.get_channel(int(location['channel_id']))
if not channel:
logger.warning(f"Channel {location['channel_id']} not found for server {server_id}")
continue
# Fetch and update the existing message
message = await channel.fetch_message(int(location['message_id']))
await message.edit(embed=embed, view=view)
update_count += 1
logger.debug(f"Updated status for {server_name}")
# Update our state tracking with new values
self.previous_states[server_id] = (current_state, cpu_usage)
else:
# No significant changes detected
skipped_count += 1
logger.debug(f"No changes detected for {server_name}, skipping update")
except discord.NotFound:
# Embed message was deleted - clean up our tracking
logger.warning(f"Embed for server {server_id} not found, removing from tracking")
self.embed_locations.pop(server_id, None)
self.previous_states.pop(server_id, None) # Also clean up state tracking
missing_count += 1
await self.save_embed_locations()
except Exception as e:
logger.error(f"Failed to update status for server {server_id}: {str(e)}")
error_count += 1
await asyncio.sleep(1) # Delay between updates
# Small delay between servers to avoid rate limits
await asyncio.sleep(0.5)
# Log summary of this update cycle
logger.info(
f"Status update complete: {update_count} updated, "
f"{missing_count} missing, {error_count} errors"
f"Update cycle complete: "
f"{update_count} updated, "
f"{skipped_count} skipped, "
f"{missing_count} missing, "
f"{error_count} errors"
)
except Exception as e:
logger.error(f"Error in update_status task: {str(e)}")
# If something went wrong, wait before retrying
await asyncio.sleep(5)
@update_status.before_loop
@@ -859,7 +926,6 @@ class PterodactylBot(commands.Bot):
if self.pterodactyl_api:
await self.pterodactyl_api.close()
await super().close()
logger.info("Bot shutting down")
# ==============================================
# DISCORD COMMANDS
@@ -1025,17 +1091,66 @@ async def on_ready():
except Exception as e:
logger.error(f"Command sync failed: {str(e)}")
# ==============================================
# SYSTEM SIGNAL HANDLERS
# ==============================================
def handle_sigint(signum: int, frame: types.FrameType) -> None:
"""
Handle SIGINT signals (Ctrl+C) by initiating graceful shutdown.
Args:
signum: The signal number (signal.SIGINT)
frame: Current stack frame (unused but required by signal handler signature)
"""
logger.info("Received SIGINT (Ctrl+C), initiating graceful shutdown...")
raise KeyboardInterrupt
def handle_sigterm(signum: int, frame: types.FrameType) -> None:
"""
Handle SIGTERM signals (container stop) by initiating graceful shutdown.
Args:
signum: The signal number (signal.SIGTERM)
frame: Current stack frame (unused but required by signal handler signature)
"""
logger.info("Received SIGTERM (container stop), initiating graceful shutdown...")
raise KeyboardInterrupt
# ==============================================
# BOT STARTUP
# ==============================================
if __name__ == "__main__":
"""
Main entry point for the bot application.
Handles:
- Signal registration for graceful shutdowns (SIGINT/SIGTERM)
- Primary bot execution loop
- Error handling and crash reporting
- Resource cleanup on shutdown
Flow:
1. Initialize signal handlers
2. Start bot with Discord token
3. Handle interrupts and exceptions
4. Execute final cleanup
"""
logger.info("Starting bot initialization")
# Register signal handlers
signal.signal(signal.SIGINT, handle_sigint) # For Ctrl+C
signal.signal(signal.SIGTERM, handle_sigterm) # For container stop commands
logger.info("System signal handlers registered")
try:
bot.run(DISCORD_TOKEN)
except KeyboardInterrupt:
logger.info("Bot shutting down due to keyboard interrupt")
logger.info("Bot shutting down")
except Exception as e:
logger.error(f"Bot crashed: {str(e)}")
sys.exit(1) # Exit with error code for crash
finally:
logger.info("Bot shutdown complete")
logger.info("Bot shutdown complete")
sys.exit(0) # Explicit clean exit

View File

@@ -1,3 +1,4 @@
discord.py>=2.3.0
aiohttp>=3.8.0
configparser>=5.3.0
configparser>=5.3.0
python-dotenv