A lightweight system monitoring tool that tracks CPU, memory, and disk usage across your infrastructure. When resource usage exceeds defined thresholds, it creates incidents in BetterStack.
- CPU usage monitoring
- Memory usage monitoring
- Disk usage monitoring (root and mounted volumes)
- Automatic incident creation and resolution
- Configurable thresholds via CLI
- Docker-based deployment
The monitoring tool is configured through command-line flags:
monitoring [flags]
Flags:
-url string
BetterStack webhook URL (required)
-interval int
Check interval in seconds (default: 300)
-cpu-limit float
CPU usage threshold percentage (default: 90)
-memory-limit float
Memory usage threshold percentage (default: 90)
-disk-limit float
Disk usage threshold percentage (default: 85)
-help
Display help information
# Basic usage with required URL
monitoring --url=https://betterstack.com/webhook/xyz
# Custom thresholds
monitoring --url=https://betterstack.com/webhook/xyz \
--cpu-limit=95 \
--memory-limit=85 \
--disk-limit=80
# More frequent checks (every minute)
monitoring --url=https://betterstack.com/webhook/xyz --interval=60
docker run -d \
--name monitoring \
--privileged \
--pid=host \
-v /:/host:ro \
ghcr.io/appwrite/monitoring:latest \
monitoring \
--url=https://betterstack.com/webhook/xyz \
--interval=300 \
--cpu-limit=90 \
--memory-limit=90 \
--disk-limit=85
The docker-compose.yml file is configured with default parameters that you can modify as needed:
docker-compose up -d
To modify the parameters, edit the command section in docker-compose.yml:
command:
- monitoring
- "--url=https://betterstack.com/webhook/xyz"
- "--interval=10"
- "--cpu-limit=90"
- "--memory-limit=80"
- "--disk-limit=85"
- Clone the repository:
git clone https://github.com/appwrite/monitoring.git
cd monitoring
- Build the binary:
go build -o monitoring
- Run the monitoring tool:
monitoring --url=https://betterstack.com/webhook/xyz
- Go 1.21 or later
- Docker and Docker Compose (for containerized deployment)
- Install dependencies:
go mod download
- Build and run:
go build -o monitoring
monitoring --url=https://betterstack.com/webhook/xyz
docker compose up -d
MIT License - see the LICENSE file for details