A self-healing cloud infrastructure monitoring system — detects failures on AWS and recovers them automatically, without human intervention.
MiniSentinel watches a Docker container's health in real time. When it goes down, MiniSentinel confirms the failure isn't a false alarm, attempts recovery with safe retry limits, verifies the fix actually worked, logs everything, backs it up to the cloud, and emails a human the moment it's genuinely stuck.
https://github.com/ShaikhAhmed39/minisentinel/releases/download/v1.0-demo/docker.stop.mp4
https://github.com/ShaikhAhmed39/minisentinel/releases/download/v1.0-demo/docker_escalated.mp4
Modern applications fail in small, predictable ways — a container crashes, a process hangs. Traditionally, someone has to notice, log in, diagnose, and manually restart it. MiniSentinel automates that entire loop:
MONITOR → DETECT → CONFIRM → RECOVER → VERIFY → LOG → ALERT
It also knows its own limits — after a fixed number of failed recovery attempts, it stops trying and escalates to a human instead of looping forever.
- Real-time health monitoring — CPU, memory, disk, and Docker container status
- Confirmation-based detection — requires 3 consecutive bad readings before acting, avoiding false alarms from temporary blips
- Automated recovery — restarts failed containers, with a cooldown period to prevent restart loops
- Retry limits & escalation — gives up gracefully after 3 failed attempts and alerts a human, rather than looping forever
- Live dashboard — auto-refreshing web UI showing current status and incident history
- Email alerts via Amazon SNS — notified the moment something needs attention
- Automated backups to Amazon S3 — every incident is archived, organized by date
- Native AWS metrics via CloudWatch — system stats pushed to a custom CloudWatch namespace
- Secure by design — EC2 uses an IAM Role for AWS access, no credentials stored on the server
Laptop (dev) ──git push/pull──▶ GitHub ──git clone/pull──▶ EC2 (AWS, Mumbai)
│
┌────────────┼────────────┐
▼ ▼ ▼
Docker monitor.py api.py
(test-app) (detect+heal) (FastAPI)
│ │
┌────────────┼─────┐ │
▼ ▼ ▼ ▼
SNS S3 CloudWatch Browser
(email alert) (backup) (metrics) (dashboard)
Backend: Python, FastAPI, psutil, boto3
Infrastructure: AWS EC2, Docker, IAM Roles
Observability: Amazon CloudWatch, Amazon SNS, Amazon S3
Frontend: HTML, CSS, JavaScript
DevOps: Git, GitHub, Linux (Ubuntu/WSL2), Bash
minisentinel/
├── core.py # Shared logic: monitoring, recovery, alerts, backups, metrics
├── monitor.py # Standalone loop: continuously checks and heals
├── api.py # FastAPI backend exposing /status and /incidents
├── dashboard/
│ └── index.html # Live-updating web dashboard
├── config.yaml # Configurable thresholds
├── requirements.txt # Python dependencies
└── incidents.log # Generated incident history (gitignored)
monitor.pychecks system stats and the target container's status every 10 seconds- If the container is down for 3 consecutive checks, recovery begins
- MiniSentinel attempts a restart, waits, then verifies the container is genuinely healthy again — never assumes success
- Every outcome (success, failure, or escalation) is logged, backed up to S3, and pushed to CloudWatch
- If an outcome is a failure or escalation, an email alert fires via SNS
- After 3 failed attempts, MiniSentinel stops trying and marks the incident as escalated — a human needs to look
- The dashboard (
api.py+dashboard/index.html) shows all of this live, refreshing every 5 seconds
git clone https://github.com/ShaikhAhmed39/minisentinel.git
cd minisentinel
pip install -r requirements.txt --break-system-packages
docker run -d --name test-app nginx
python3 -m uvicorn api:app --reload --port 8000In a separate terminal:
python3 monitor.pyOpen dashboard/index.html in a browser (update API_URL if not running locally).
- Launch an EC2 instance (Ubuntu, t3.micro — free tier eligible)
- Attach an IAM Role with
AmazonSNSFullAccess,AmazonS3FullAccess,CloudWatchFullAccess - Install Docker and Python on the instance
- Clone this repo and install dependencies
- Open port 8000 in the instance's Security Group
- Run the API and monitor with
nohup ... -u ... &to keep them alive after disconnecting - Point
dashboard/index.html'sAPI_URLat the instance's public IP
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /status |
Current system stats and container health |
| GET | /incidents |
Recent incident history (detection, recovery, escalation) |
- Why confirm before acting? A single bad reading can be a temporary blip. Requiring 3 consecutive failures avoids restarting a healthy container unnecessarily.
- Why a cooldown between restarts? Prevents restart loops — a container that keeps failing shouldn't be restarted every few seconds forever.
- Why escalate instead of retrying forever? A responsible automation system knows when a problem is beyond its own ability to fix, and hands off to a human rather than looping indefinitely.
- Why an IAM Role instead of access keys on the server? Storing AWS credentials on a server is a security risk if that server is ever compromised. An IAM Role grants the same permissions without any secret ever living on disk.
Ahmed Shaikh GitHub • LinkedIn
This project is for educational and portfolio purposes.