Add verbose log() coverage across Docker_Essentials, unRAID_Essentials, Transcodes, and Orchestrators

- Config/threshold dumps at startup in every script (retry counts, timeouts, sizes, thresholds)
- Per-item detail in verbose: container images, timing per container/share/job, image ID diffs
- Orchestrators: watchdog cycle now logs array state, grace state, per-script timing; transcode_management shows ramdisk state before each cycle; critical_sync logs share list and maintenance scripts; coffee report logs server state at run time
- Summary counts replaced with names in verbose where previously only counts were shown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gmer4Lfe
2026-06-01 20:51:34 -04:00
co-authored by Claude Sonnet 4.6
parent 8f696d85f7
commit bc70ebe5ee
18 changed files with 126 additions and 23 deletions
+3
View File
@@ -165,6 +165,9 @@ fi
# ==============================================================================================
# ━━━ Clear Logs ━━━
# ==============================================================================================
log "$ICON_GEAR Config: system-threshold=${LOG_MIN_SIZE_MB:-10}MB docker-threshold=${LOG_DOCKER_MAX_MB:-100}MB"
log "$ICON_GEAR System logs: ${LOG_FILES[*]}"
START=$(date +%s)
SYS_CLEARED=0
SYS_SKIPPED=0
+3
View File
@@ -132,7 +132,10 @@ if ! pgrep -f "emhttp.*Mover" >/dev/null 2>&1; then
fi
MOVER_PID=$(pgrep -f "emhttp.*Mover" | head -1)
MOVER_START=$(ps -o lstart= -p "$MOVER_PID" 2>/dev/null | xargs)
MOVER_ELAPSED=$(ps -o etimes= -p "$MOVER_PID" 2>/dev/null | tr -d ' ')
warn "Mover is running (PID $MOVER_PID) — stopping in ${MOVER_STOP_TIMEOUT}s"
log "$ICON_TIME Mover started: ${MOVER_START:-unknown} — running for $(format_duration "${MOVER_ELAPSED:-0}")"
# ── Warn users via wall ───────────────────────────────────────────────────────────────────────
if [[ "$DRY_RUN" == false ]]; then
@@ -226,6 +226,9 @@ else
log "Verified: pm.max_children = $APPLIED_VAL"
fi
FPM_WORKERS=$(pgrep -fc "php-fpm" 2>/dev/null || echo "?")
log "$ICON_PHP Workers running: $FPM_WORKERS"
END=$(date +%s)
# ==============================================================================================
+8
View File
@@ -194,6 +194,14 @@ if [[ -n "${EMBY_URL:-}" ]] && [[ -n "${EMBY_API_KEY:-}" ]]; then
fi
fi
CONTAINER_COUNT=$(docker ps -q 2>/dev/null | wc -l || echo 0)
log "$ICON_CONTAINERS Docker: ${CONTAINER_COUNT} container(s) running"
if is_vm_manager_enabled && command -v virsh >/dev/null 2>&1; then
VM_COUNT=$(virsh list --name 2>/dev/null | grep -c "." || echo 0)
log "$ICON_GEAR VMs: ${VM_COUNT} running"
fi
if [[ ${#WARNINGS[@]} -eq 0 ]]; then
log "Pre-flight clean — no active processes to warn about"
else
@@ -40,6 +40,9 @@ detect_hosts
CONF_FILE="$SCRIPT_DIR/../Configurations/${MY_ID,,}.conf"
VAR_NAME="${MY_ID}_UNRAID_API_KEY"
log "$ICON_GEAR Conf file: $CONF_FILE"
log "$ICON_GEAR Key var: $VAR_NAME"
if [[ ! -f "$CONF_FILE" ]]; then
error "Conf file not found: $CONF_FILE"
exit 1
@@ -54,15 +57,19 @@ fi
# Check if key already exists in the unraid-api registry before creating.
# --overwrite generates a new key value every time, invalidating the old one.
# Only renew if the registry has lost it.
log "Checking unraid-api registry for existing Varaverk key..."
EXISTING=$(timeout 5 /usr/local/sbin/unraid-api apikey --name "Varaverk" --json </dev/null 2>/dev/null)
KEY=$(echo "$EXISTING" | jq -r '.key // empty' 2>/dev/null)
if [[ -n "$KEY" ]]; then
PREVIEW="${KEY:0:8}...${KEY: -4}"
echo "API key valid ✅ — $VAR_NAME = $PREVIEW"
log "Key found in registry — no renewal needed"
exit 0
fi
log "Key not found in registry — creating new key..."
RAW=$(timeout 10 /usr/local/sbin/unraid-api apikey \
--name "Varaverk" --create --overwrite \
--description "Varaverk plugin" --roles ADMIN --json </dev/null 2>&1)
@@ -87,4 +94,5 @@ else
fi
PREVIEW="${KEY:0:8}...${KEY: -4}"
log "Writing new key to: $CONF_FILE"
warn "API key renewed ✅ — $VAR_NAME = $PREVIEW (registry had lost it)"