| title | Installation |
|---|---|
| layout | default |
| nav_order | 3 |
This repo supports three install modes — dev, production (bare metal), and Docker:
[toc]
- Python 3.10+
uv- Dependencies are defined in
pyproject.toml
git clone git@github.com:ikidnapmyself/server-monitoring.git
cd server-monitoring./bin/install.shIf you get "permission denied", run:
chmod +x ./bin/*.sh./bin/install.sh performs these steps:
- Verifies Python is 3.10+
- Installs
uvif missing - Ensures you have a
.env(creates it from.env.sampleif present) - Prompts you for dev, production, or docker mode and appends missing
.envkeys- It does not overwrite existing values
- Installs dependencies with
uv sync- dev installs include dev extras
- prod installs are runtime-only
- Runs Django migrations
- Runs
python manage.py check - Optionally runs health checks now
- Optionally sets up cron via
./bin/install.sh cron - Optionally sets up shell aliases via
./bin/install.sh aliases
See the installer implementation in bin/install.sh.
If you didn't enable cron during install, you can run it later:
./bin/install.sh cron- Detects the project directory automatically
- Lets you choose a schedule (every 5 min / 15 min / hourly / etc. or custom)
- Writes a
crontabentry that runs:
uv run python manage.py run_pipeline --checks-only --json- Logs output to
cron.login the project root
See the cron script in bin/install.sh cron.
crontab -l
tail -f ./cron.logShell aliases let you run sm-check-health instead of uv run python manage.py check_health.
If you didn't set up aliases during install, run:
./bin/install.sh aliasesIt will prompt for a prefix (default: sm), generate aliases, and add a source line to your shell profile.
| Alias | What it does |
|---|---|
sm-check-health |
Run health checks (CPU, memory, disk, network, process) |
sm-run-pipeline |
Execute pipelines (--sample / --checks-only / --file) |
sm-check-and-alert |
Run checks through the pipeline (run_pipeline --checks-only) |
sm-get-recommendations |
Get AI-powered system recommendations |
sm-cli |
Interactive CLI menu |
All aliases pass flags through: sm-check-health --json = uv run python manage.py check_health --json.
See bin/README.md for the full alias table and script details.
./bin/install.sh aliases --prefix maint
# Creates: maint-check-health, maint-run-pipeline, etc../bin/install.sh aliases --removeThe installer supports saving and loading configuration profiles for consistent deployments across machines.
After running the installer, save the configuration:
./bin/install.sh --save-profile prod-webThis creates .install-profile-prod-web containing all non-sensitive configuration values.
On a new machine, load a saved profile to pre-fill all prompts:
./bin/install.sh --profile prod-webValues from the profile appear as defaults — press Enter to accept or type a new value to override.
For automated deployments, combine --profile with --yes to accept all defaults:
./bin/install.sh --profile prod-web --yesOnly secrets (DJANGO_SECRET_KEY, HUB_API_KEY) will still be prompted since they are never stored in profiles.
After installation, use the interactive CLI for a guided experience:
./bin/cli.shThe CLI provides menus for all management commands with their available options.
Direct shortcuts:
./bin/cli.sh health # Health monitoring
./bin/cli.sh intel # Intelligence recommendations
./bin/cli.sh pipeline # Pipeline orchestration
./bin/cli.sh notify # NotificationsVerify your installation is working correctly:
./bin/check_system.shThis auto-detects your deployment mode (dev/prod/docker/systemd) and runs the relevant checks — Python version, uv, .env, .venv, Django, migrations, pre-commit hooks, Docker containers, or systemd services.
./bin/check_system.sh --json # JSON output (for CI/monitoring)Use this if you want full control or you're running in CI.
git clone git@github.com:ikidnapmyself/server-monitoring.git
cd server-monitoringpython3 -m venv .venv
. .venv/bin/activatepython -m pip install --upgrade pip
pip install uvcp .env.sample .envSet at least a secret key (required for real deployments):
# example
echo 'DJANGO_SECRET_KEY=change-me' >> .envProduction-style (no dev tools):
uv sync --frozen --no-devDev install (includes dev tools/extras):
uv sync --all-extras --devuv run --frozen python manage.py migrate --noinputuv run python manage.py checkuv run python manage.py runserverWith aliases (after running ./bin/install.sh aliases):
sm-check-health # Run health checks
sm-check-health --list # List available checkers
sm-check-and-alert --json # Run checks through pipeline (cron-friendly)
sm-get-recommendations --all # Get system recommendations
sm-run-pipeline --sample # Run pipeline with sample alertWithout aliases:
uv run python manage.py check_health
uv run python manage.py check_health --list
uv run python manage.py run_pipeline --checks-only --json
uv run python manage.py get_recommendations --all
uv run python manage.py run_pipeline --samplesm-cluster # guided: notification channel + a catch-all routing pipeline
# or manage routing pipelines directly in Django Admin (Orchestration → Pipeline definitions)
uv run python manage.py setup_intelligence # optional: pick an AI providerThe CHECK stage runs all registered checkers by default; a routing PipelineDefinition's
ordered stages list — a subset of ["check", "analyze", "notify"] — selects which
downstream stages run for a matched alert, and its single channel is the notify
target. Traffic no active lane matches fails as no_route, so keep a catch-all lane
(empty match) unless you deliberately want unrouted alerts to fail loudly.
sm-run-pipeline --sample --dry-runsm-run-pipeline --sample # full demo run (real checks + notify)
sm-run-pipeline --checks-only # local monitoring: CHECK is the entry stage, then
# the lane matched from the alert it produced runs
# (the seeded `hub-self-check` lane records only)sm-run-pipeline --file alert.json # run from a JSON payload file
sm-monitor-pipeline # pipeline run history
sm-test-notify --driver slack # test notification deliveryuv run python manage.py setup_cluster
uv run python manage.py run_pipeline --sample --dry-run
uv run python manage.py run_pipeline --sampleJourney/report shortcuts: manage.py trace <alert|trace_id> and manage.py report.
For full pipeline docs, see apps/orchestration/README.md.
For production deployment (Nginx + the broker-free inbox drain), see the Deployment Guide. It covers:
- Docker Compose — Django (gunicorn) + the
process_inboxdrain (recommended for quick deploys) - Bare metal / VPS — systemd units for gunicorn and the inbox drain
- Nginx reverse proxy — static files, proxy headers, SSL termination
- Webhook ingestion — durable ingest: record a PENDING run, drain processes it