Skip to content

celestingm/Aegis-RS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aegis-RS

Autonomous Self-Healing Infrastructure Orchestrator

Built with Rust, Tokio, and Clean Architecture.

Rust Docker Build Status License


Aegis-RS is a lightweight, high-performance monitoring and self-healing agent for your servers. It continuously tracks CPU, RAM, and Disk usage alongside your Docker service health, and sends rich status reports with graphs to your team — all with zero external dependencies.

Features

  • Multi-Metric Monitoring — Tracks CPU usage, RAM (used/total), Disk usage, and Docker service health every 10 seconds.
  • Self-Healing — Automatically restarts crashed or unhealthy Docker services and cleans logs on disk pressure.
  • Rich Status Reports — Sends periodic reports with a PNG chart showing historical trends of all metrics.
  • Multi-Platform Notifications — Supports Discord (live dashboard with editing), Slack, and Microsoft Teams.
  • Live Web Dashboard — Auto-refreshing SVG graph available at http://localhost:3001/graph.
  • CLI Webhook Management — Add or list webhooks directly from the command line.
  • Prometheus Endpoint — Exposes /metrics for integration with Grafana or other tools.
  • Clean Architecture — Hexagonal design for maximum maintainability and testability.

Installation

Option 1: Download Binary (Recommended)

  1. Go to the Releases page.
  2. Download the latest aegis-rs binary for Linux.
  3. Make it executable and run it:
chmod +x aegis-rs
./aegis-rs

Option 2: Build from Source

# Prerequisites: Rust toolchain + libfontconfig
sudo apt-get install libfontconfig1-dev

git clone https://github.com/celestingm/Aegis-RS.git
cd Aegis-RS

cargo build --release
./target/release/aegis-rs

Configuration

Copy the example config file and edit it:

cp config.example.toml config.toml
# config.toml
api_port = 3001
secret_token = "change-me-to-a-secure-token"
disk_threshold = 90
docker_services = ["grafana", "prometheus", "backend", "frontend"]

# Discord Webhook (Live Dashboard - updates the same message)
[[webhooks]]
url = "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN"
provider = "discord"

# Microsoft Teams (Hourly report)
# [[webhooks]]
# url = "https://your-teams-workflow-url"
# provider = "teams"

# Slack (Hourly report)
# [[webhooks]]
# url = "https://hooks.slack.com/services/YOUR/SLACK/HOOK"
# provider = "slack"

Run with a custom config path:

./aegis-rs --config /etc/aegis/config.toml

CLI: Webhook Management

# Add a webhook
./aegis-rs webhook add --url "https://discord.com/api/webhooks/..." --provider discord

# List configured webhooks
./aegis-rs webhook list

API Reference

Endpoint Method Description Auth
/metrics GET Prometheus-compatible metrics output. No
/graph GET Live auto-refreshing SVG graph. No
/webhook POST Trigger manual remediation actions. Yes

The /webhook endpoint requires a Bearer token matching secret_token in your config.


Architecture

Aegis-RS follows Clean Architecture (Hexagonal) principles.

graph TD
    User((User / Browser)) --> Presentation
    subgraph "Aegis-RS Core"
        Presentation["Presentation\n(Axum HTTP API)"] --> Application
        Application["Application\n(Orchestrator)"] --> Domain
        Infrastructure["Infrastructure\n(Docker, Sysinfo, Notifiers)"] -.->|Implements Ports| Domain
        Application -->|Uses| Infrastructure
    end
    Domain["Domain\n(Entities & Ports)"]
Loading
  • Domain — Pure Rust structs (SystemMetrics, Alert, HealthStatus) and port trait definitions. Zero external dependencies.
  • Application — The Orchestrator event loop driving health checks, remediation, graph generation, and notification dispatch.
  • Infrastructure — Concrete adapters: SystemMonitor (sysinfo), DockerMonitor, WebhookNotifier (reqwest), FileConfigLoader.
  • Presentation — Axum-based HTTP server exposing metrics, graph, and webhook endpoints.

License

MIT

About

Autonomous self-healing orchestrator written in Rust. Monitors system health and triggers automated remediation actions via local checks or Grafana webhooks.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors