Files
oikos/tools/setup-checks.sh
dtoro b87735a111
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled
chore: graph view, dns-zone gap, fleet deploy/cleanup tooling
Graph view: raise the node cap 500 -> 2000 and exclude execution/task audit
rows from the default whole-graph view so the cap is spent on actual topology
rather than ~380 cognition records that crowded out every host/lxc/service.

dns-zone monitoring [dns] -> none: no dns checker exists, so the declaration
only produced unresolvable `unmonitored` noise (requires ontology re-ingest;
coverageSweep now auto-clears the stale signals). Flip back to [dns] when a
checker lands.

Operator tooling: tools/deploy-checks.sh pushes check scripts into guests via
pct push (a pct-exec-routed check runs the script INSIDE the guest), wired
into the post-pull setup-checks hook so guests stay in sync on Proxmox hosts;
scripts/cleanup-orphan-checks.sh (dry-run by default) and
report-stray-test-lxcs.sh retire legacy cruft. VERSION 0.13.0 -> 0.14.0.

Plan: plans/2026-07-29-health-check-reality-and-knowledge-graph.md.
2026-07-29 13:37:27 +02:00

36 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# setup-checks.sh — deploy check scripts to /opt/oikos/checks.
# Auto-setup hook: tools/setup-*.sh runs after every git pull.
#
# On a plain host/workstation this installs the scripts locally (the pulling
# host). On a Proxmox host it ALSO pushes the scripts into every running LXC/VM
# guest, because an ssh-script check runs the script INSIDE the target — a
# script present only on the host does nothing for a guest reached via
# pct/qm exec. Guest deployment is delegated to deploy-checks.sh.
set -euo pipefail
CLONE_DIR="${HOMELAB_CONTEXT_DIR:-/opt/homelab}"
CHECK_SETUP="$CLONE_DIR/checks/install.sh"
DEPLOY="$CLONE_DIR/tools/deploy-checks.sh"
if [ -f "$CHECK_SETUP" ]; then
bash "$CHECK_SETUP" || echo "[setup-checks] WARNING: install.sh exited with code $?"
else
echo "[setup-checks] no checks/install.sh found, skipping"
fi
# On a Proxmox host, keep every guest's scripts in sync too. Best-effort: a
# failing push to one guest must not abort the whole hook. Warn (not skip
# silently) if deploy-checks.sh itself is absent — without it guests never get
# scripts and the pct-exec routing reports every guest check down.
if command -v pct >/dev/null 2>&1; then
if [ ! -f "$DEPLOY" ]; then
echo "[setup-checks] WARNING: $DEPLOY missing — guest scripts will go stale. Commit tools/deploy-checks.sh alongside this hook."
elif [ ! -x "$DEPLOY" ]; then
echo "[setup-checks] WARNING: $DEPLOY not executable — running via bash"
bash "$DEPLOY" || echo "[setup-checks] WARNING: guest deploy exited non-zero (scripts may be stale on some guests)"
else
"$DEPLOY" || echo "[setup-checks] WARNING: guest deploy exited non-zero (scripts may be stale on some guests)"
fi
fi