forked from finn/tinyboard
health-check.sh: only check last 60 seconds of autossh logs for tunnel failures to avoid false positives from old log entries
This commit is contained in:
@@ -121,7 +121,7 @@ check_spoke() {
|
|||||||
ok "autossh container running ($autossh_container)"
|
ok "autossh container running ($autossh_container)"
|
||||||
|
|
||||||
local logs
|
local logs
|
||||||
logs=$(docker logs "$autossh_container" 2>&1 | tail -20 || true)
|
logs=$(docker logs "$autossh_container" --since 60s 2>&1 || true)
|
||||||
if echo "$logs" | grep -q "remote port forwarding failed"; then
|
if echo "$logs" | grep -q "remote port forwarding failed"; then
|
||||||
fail "Tunnel reports port forwarding failed — check hub authorized_keys"
|
fail "Tunnel reports port forwarding failed — check hub authorized_keys"
|
||||||
else
|
else
|
||||||
@@ -206,7 +206,7 @@ check_hub() {
|
|||||||
fail "rclone remote [${spoke_name}-remote] not found in rclone.conf"
|
fail "rclone remote [${spoke_name}-remote] not found in rclone.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if crontab -u "$(basename "$HUB_HOME")" -l 2>/dev/null | grep -q "${spoke_name}-remote:"; then
|
if crontab -u "$(basename "$HUB_HOME")" -l 2>/dev/null | grep -qE "${spoke_name}-remote:|mount-${spoke_name}"; then
|
||||||
ok "Auto-mount crontab entry present"
|
ok "Auto-mount crontab entry present"
|
||||||
else
|
else
|
||||||
warn "No auto-mount crontab entry for $spoke_name"
|
warn "No auto-mount crontab entry for $spoke_name"
|
||||||
|
|||||||
Reference in New Issue
Block a user