fix(watchdogs): Tailscale false positive + system watchdog banner
network_watchdog: Tailscale JSON uses "BackendState": "Running" (with space) but grep pattern matched "BackendState":"Running" (no space) — always failed. Switched to grep -qE with \s* to handle both forms. system_watchdog: add echo banner at run start so its output is visually separated from docker_watchdog in orchestrator logs. Previously appeared as a continuation of the docker section since docker_watchdog has a banner but system_watchdog did not.
This commit is contained in:
@@ -173,7 +173,7 @@ if [[ "$SHOW_STATUS" == true ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]] && command -v tailscale >/dev/null 2>&1; then
|
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]] && command -v tailscale >/dev/null 2>&1; then
|
||||||
if tailscale status --json 2>/dev/null | grep -q '"BackendState":"Running"'; then
|
if tailscale status --json 2>/dev/null | grep -qE '"BackendState":\s*"Running"'; then
|
||||||
echo " $ICON_SUCCESS Tailscale: running"
|
echo " $ICON_SUCCESS Tailscale: running"
|
||||||
else
|
else
|
||||||
echo " $ICON_ERROR Tailscale: NOT running"
|
echo " $ICON_ERROR Tailscale: NOT running"
|
||||||
@@ -254,7 +254,7 @@ fi
|
|||||||
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]]; then
|
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]]; then
|
||||||
if ! command -v tailscale >/dev/null 2>&1; then
|
if ! command -v tailscale >/dev/null 2>&1; then
|
||||||
log "Tailscale not installed — skipping"
|
log "Tailscale not installed — skipping"
|
||||||
elif tailscale status --json 2>/dev/null | grep -q '"BackendState":"Running"'; then
|
elif tailscale status --json 2>/dev/null | grep -qE '"BackendState":\s*"Running"'; then
|
||||||
log "$ICON_SUCCESS Tailscale running"
|
log "$ICON_SUCCESS Tailscale running"
|
||||||
else
|
else
|
||||||
warn "$ICON_ERROR Tailscale not in Running state"
|
warn "$ICON_ERROR Tailscale not in Running state"
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ fi
|
|||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
# ━━━ Run Sequence ━━━
|
# ━━━ Run Sequence ━━━
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
echo "━━━ $ICON_SHIELD System Watchdog — $(date '+%Y-%m-%d %H:%M:%S') ━━━"
|
||||||
|
|
||||||
START=$(date +%s)
|
START=$(date +%s)
|
||||||
PASSED=()
|
PASSED=()
|
||||||
FAILED=()
|
FAILED=()
|
||||||
|
|||||||
Reference in New Issue
Block a user