sync: 2026-03-15 23:30 — 23 files from Alexandria
Some checks failed
Lint & Format / detect (push) Failing after 39s
Monorepo Lint / lint-shell (push) Failing after 41s
Monorepo Lint / lint-js (push) Failing after 38s
Lint & Format / js-lint (push) Has been skipped
Lint & Format / py-lint (push) Has been skipped
Lint & Format / sh-lint (push) Has been skipped
Lint & Format / go-lint (push) Has been skipped

RoadChain-SHA2048: af46e6a9314c50fd
RoadChain-Identity: alexa@sovereign
RoadChain-Full: af46e6a9314c50fddd4a6fa4df62988ead75ad66dc383f6fb38c1824a5d184b6d98a78f10dacb6cdbf2ac198396fe3ab2e07c187ab6e41b1dbc44f60de268c283ce6519708dba7899d2faa19e687ce9b6f590a9c89cd995ce5636bdb24a6b0406eb730e9ed1033171839e7d82b903fd60f3c2c2e3c9ef6fbbc3ef52f7ca87ede13bedc69fee77c465a1fe292e4580cf9e9661b2321ee66483dc6368ee913231aa830a83b267901a304701129a337a81f15e67c8e808f7d519ffd1303cf652ce9ef8c98a42df19a7ca69236ee0be44a0569cef18eaeaf14b16fb284e99ae357375380a3c76dd0588e7993aea0c8a0326a3b751bd44f0943251f86ee164fb1786c
This commit is contained in:
2026-03-15 23:30:01 -05:00
parent ac7b9b5958
commit 4f0bac406e
23 changed files with 494 additions and 252 deletions

View File

@@ -18,9 +18,22 @@ mkdir -p "$LOG_DIR" "$STATE_DIR"
STATS_URL="https://stats-blackroad.amundsonalexa.workers.dev"
STATS_KEY="blackroad-stats-push-2026"
SLACK_URL="https://blackroad-slack.amundsonalexa.workers.dev"
log() { printf "[%s] %s\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$1"; }
slack_alert() {
curl -s --max-time 5 -X POST "$SLACK_URL/alert" \
-H "Content-Type: application/json" \
-d "{\"text\":\"$1\"}" >/dev/null 2>&1 || true
}
slack_post() {
curl -s --max-time 5 -X POST "$SLACK_URL/post" \
-H "Content-Type: application/json" \
-d "{\"text\":\"$1\"}" >/dev/null 2>&1 || true
}
# ── 1. PROBE ALL NODES ──
probe_node() {
local name=$1
@@ -35,7 +48,7 @@ probe_node() {
echo "{\"name\":\"$name\",\"ip\":\"$ip\",\"status\":\"down\",\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}" > "$state_file"
if [[ "$prev_status" != "down" ]]; then
log "ALERT: $name ($ip) went DOWN"
# Could push to Slack here
slack_alert "🔴 *$name* ($ip) went DOWN"
fi
return
fi
@@ -69,12 +82,13 @@ EOF
# State change alerts
if [[ "$prev_status" == "down" || "$prev_status" == "ssh_fail" ]]; then
log "RECOVERED: $name ($ip) is back UP"
slack_post "🟢 *$name* ($ip) recovered — back online"
fi
# Threshold alerts
if [[ "$disk" -gt 90 ]]; then log "ALERT: $name disk at ${disk}%"; fi
if [[ "$temp" -gt 75 ]]; then log "ALERT: $name temp at ${temp}C"; fi
if [[ "$mem_free" -lt 200 ]]; then log "ALERT: $name low memory (${mem_free}MB free)"; fi
if [[ "$disk" -gt 90 ]]; then log "ALERT: $name disk at ${disk}%"; slack_alert "💾 *$name* disk critical: ${disk}%"; fi
if [[ "$temp" -gt 75 ]]; then log "ALERT: $name temp at ${temp}C"; slack_alert "🌡️ *$name* overheating: ${temp}°C"; fi
if [[ "$mem_free" -lt 200 ]]; then log "ALERT: $name low memory (${mem_free}MB free)"; slack_alert "🧠 *$name* low memory: ${mem_free}MB free"; fi
}
# ── 2. SERVICE HEALTH CHECKS ──