Skip to content

birdcheck is a simple Go application that provides an API to monitor system status, including GPU information, running Docker containers, and whether Steam is running. It also offers an endpoint to list .wav files from a configured directory. It's used with aibird.

Notifications You must be signed in to change notification settings

birdneststream/birdcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

birdcheck

birdcheck is a simple Go application that provides an API to monitor system status, including GPU information, running Docker containers, and whether Steam is running. It also offers an endpoint to list .wav files from a configured directory. It's used with aibird.

Features

  • System Status (/api/status):

    • Checks if the Steam process is running.
    • Lists running Docker containers of interest (ollama, comfyui, comfyui-2070, comfyui-4090).
    • Provides detailed information for NVIDIA GPUs, including temperature, memory usage, power draw, fan speed, and GPU utilization.
  • List .wav Files (/api/wavs):

    • Recursively lists all .wav files from a directory specified in config.toml.

Configuration

The application is configured via a config.toml file in the same directory.

# config.toml
wav_directory = "/path/to/your/wav/files"
api_key = "your-secure-api-key-here"
voices = [
  "voice1", "voice2", "voice3"
]
  • wav_directory: The absolute path to the directory you want to scan for .wav files.
  • api_key: A secure API key required for all API requests. Change the default value "changeme".
  • voices: Array of available TTS voice names (optional, mainly for documentation).

Authentication

All API endpoints require authentication via the X-API-Key header.

Example request:

curl -H "X-API-Key: your-secure-api-key-here" http://localhost:8099/api/status

API Endpoints

GET /api/status

Returns a JSON object with the current system status.

Example Response:

{
  "steam_running": true,
  "docker_status": {
    "ollama": true,
    "comfyui": true,
    "comfyui_2070": false
  },
  "gpus": [
    {
      "name": "NVIDIA GeForce RTX 4090",
      "temperature": "55°C",
      "memory_used": "2048 MB",
      "memory_total": "24576 MB",
      "power_draw": "120 W",
      "fan_speed": "30%",
      "utilization_gpu": "15%"
    }
  ],
  "error": ""
}

GET /api/wavs

Returns a JSON array of strings, where each string is the name of a .wav file (without the extension).

Example Response:

[
  "sound1",
  "sound2"
]

Prerequisites

  • Go
  • NVIDIA drivers and nvidia-smi installed (for GPU monitoring)
  • Docker installed (for Docker container monitoring)

Installation and Usage

  1. Clone the repository or download the source code.
  2. Install dependencies:
    go mod tidy
  3. Copy config.toml.example to config.toml and configure your settings:
    cp config.toml.example config.toml
  4. Edit config.toml and set your wav_directory, api_key, and voices.
  5. Build the application:
    go build
  6. Run the application:
    ./birdcheck

The server will start on port 8099.

Security Notes

  • Change the default API key from "changeme" to a secure value.
  • The application will warn you on startup if you're using the default API key.
  • Consider running the service behind a reverse proxy for additional security.

About

birdcheck is a simple Go application that provides an API to monitor system status, including GPU information, running Docker containers, and whether Steam is running. It also offers an endpoint to list .wav files from a configured directory. It's used with aibird.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages