refactor: rename resource_manager → resource_watchdog, RM_ → RW_
Consistent naming with the watchdog family (system_watchdog, docker_watchdog). File renamed, all RM_ config variables and internal references updated to RW_ across master.conf, master_host1.conf, common.sh, docker_watchdog.sh, system_watchdog.sh, watchdog_orchestrator.sh, and sunday_morning_coffee_report.sh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
309546e615
commit
9a5f6f88f2
@@ -14,7 +14,7 @@
|
||||
# 🎬 Transcodes — ramdisk usage, weekly peak, flips, session split
|
||||
# 🎵 Media Activity — arr cleanup stats, arr recovery stats, queue depth
|
||||
# 🌐 Rsync — weekly transfer totals, per-share breakdown, failures
|
||||
# 🛡️ Watchdog — resource manager, system watchdog, docker watchdog, fallback state
|
||||
# 🛡️ Watchdog — resource watchdog, system watchdog, docker watchdog, fallback state
|
||||
# 🔐 Security — SSL cert expiry per domain
|
||||
# 📊 Emby — weekly stream count, active now, top users
|
||||
# ⚙️ System Health — SMART summary, inotify, php-fpm, Docker, Gitea sync
|
||||
@@ -562,12 +562,12 @@ if [[ -f "$WATCHDOG_CONTAINER_RESTART_LOG" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── Resource Manager ─────────────────────────────────────────────────────────────────────────
|
||||
line "🎛️ Resource Manager"
|
||||
if [[ -f "$RM_STATE_FILE" ]]; then
|
||||
_rm_last=$(stat -c %Y "$RM_STATE_FILE" 2>/dev/null || echo 0)
|
||||
# ── Resource Watchdog ─────────────────────────────────────────────────────────────────────────
|
||||
line "🎛️ Resource Watchdog"
|
||||
if [[ -f "$RW_STATE_FILE" ]]; then
|
||||
_rm_last=$(stat -c %Y "$RW_STATE_FILE" 2>/dev/null || echo 0)
|
||||
_rm_ago=$(( NOW - _rm_last ))
|
||||
_rm_level=$(grep "^current_level:" "$RM_STATE_FILE" 2>/dev/null | cut -d: -f2)
|
||||
_rm_level=$(grep "^current_level:" "$RW_STATE_FILE" 2>/dev/null | cut -d: -f2)
|
||||
_rm_level="${_rm_level:-0}"
|
||||
if [[ "$_rm_level" -gt 0 ]]; then
|
||||
issue " Pressure level ${_rm_level} active │ Last run: $(_fmt_uptime "$_rm_ago") ago"
|
||||
@@ -577,7 +577,7 @@ if [[ -f "$RM_STATE_FILE" ]]; then
|
||||
issue " Last run: $(_fmt_uptime "$_rm_ago") ago — watchdog_orchestrator may not be running"
|
||||
fi
|
||||
else
|
||||
line " ℹ️ State file not found (resource_manager may not have run yet)"
|
||||
line " ℹ️ State file not found (resource_watchdog may not have run yet)"
|
||||
fi
|
||||
|
||||
REPORT+=("")
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
# Schedule: * * * * * (every minute via User Scripts plugin)
|
||||
#
|
||||
# ── EXECUTION ORDER ───────────────────────────────────────────────────────────────────────────
|
||||
# 1. resource_manager.sh — reduce system pressure intelligently
|
||||
# 1. resource_watchdog.sh — reduce system pressure intelligently
|
||||
# 2. docker_watchdog.sh — heal containers with freed resources
|
||||
# 3. system_watchdog.sh — reboot if all else fails (last line of defense)
|
||||
#
|
||||
# ── WHY ORDER MATTERS ─────────────────────────────────────────────────────────────────────────
|
||||
# Resource Manager first — frees RAM and CPU before healing attempts container restarts.
|
||||
# Resource Watchdog first — frees RAM and CPU before healing attempts container restarts.
|
||||
# Containers restarted into a resource-pressured system just fail again.
|
||||
# Docker Watchdog second — restarts with pressure already reduced, more likely to stabilise.
|
||||
# System Watchdog last — only triggers if prior layers could not resolve the issue.
|
||||
@@ -63,7 +63,7 @@ acquire_lock
|
||||
|
||||
detect_hosts
|
||||
|
||||
RESOURCE_MANAGER="$ECOSYSTEM_ROOT/unRAID_Essentials/resource_manager.sh"
|
||||
RESOURCE_WATCHDOG="$ECOSYSTEM_ROOT/unRAID_Essentials/resource_watchdog.sh"
|
||||
DOCKER_WATCHDOG="$ECOSYSTEM_ROOT/Docker_Essentials/docker_watchdog.sh"
|
||||
SYSTEM_WATCHDOG="$ECOSYSTEM_ROOT/unRAID_Essentials/system_watchdog.sh"
|
||||
|
||||
@@ -88,7 +88,7 @@ if [[ "$SHOW_STATUS" == true ]]; then
|
||||
echo ""
|
||||
echo "── Sub-scripts ──"
|
||||
for pair in \
|
||||
"Resource Manager:$RESOURCE_MANAGER" \
|
||||
"Resource Watchdog:$RESOURCE_WATCHDOG" \
|
||||
"Docker Watchdog:$DOCKER_WATCHDOG" \
|
||||
"System Watchdog:$SYSTEM_WATCHDOG"; do
|
||||
label="${pair%%:*}"
|
||||
@@ -150,7 +150,7 @@ run_watchdog() {
|
||||
fi
|
||||
}
|
||||
|
||||
run_watchdog "Resource Manager" "$RESOURCE_MANAGER"
|
||||
run_watchdog "Resource Watchdog" "$RESOURCE_WATCHDOG"
|
||||
run_watchdog "Docker Watchdog" "$DOCKER_WATCHDOG"
|
||||
run_watchdog "System Watchdog" "$SYSTEM_WATCHDOG"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user