Add docker actions, arr profile enforcer, monitor caching, and web file symlink

Web files now served via symlink to the git repo so git pull changes survive
reboots without rebuilding the txz. Also includes: docker pull/rebuild/restart
with live log streaming, arr_profile_enforcer for Sonarr/Radarr quality
profiles, monitor page cache fix (background writer now in cron), and
ARR_KIDS/SONARR/RADARR profile name vars in master.conf.
This commit is contained in:
Gmer4Lfe
2026-06-19 11:09:40 -04:00
parent ac2986b141
commit f42ecc8464
15 changed files with 657 additions and 62 deletions
+12 -2
View File
@@ -233,6 +233,11 @@ function vv_watchdog_summary(): array {
$zombies = (int)trim(shell_exec("ps -eo stat 2>/dev/null | grep -c '^Z'") ?: '0');
$fileNr = explode("\t", trim(@file_get_contents('/proc/sys/fs/file-nr') ?: '0 0 1'));
$fdOpen = max(0, (int)($fileNr[0] ?? 0) - (int)($fileNr[1] ?? 0));
$fdMax = max(1, (int)($fileNr[2] ?? 1));
$fdPct = round($fdOpen / $fdMax * 100, 1);
$nic = trim(shell_exec("ip route show default 2>/dev/null | awk 'NR==1{print \$5}'") ?: 'eth0') ?: 'eth0';
$nicState = trim(@file_get_contents("/sys/class/net/$nic/operstate") ?: 'unknown');
$sshdOk = (int)trim(shell_exec('pgrep -c sshd 2>/dev/null') ?: '0') > 0;
@@ -260,6 +265,9 @@ function vv_watchdog_summary(): array {
'load_1min' => $load1,
'cpu_temp' => $cpuTemp,
'zombies' => $zombies,
'fd_open' => $fdOpen,
'fd_max' => $fdMax,
'fd_pct' => $fdPct,
'nic' => $nic,
'nic_state' => $nicState,
'sshd_ok' => $sshdOk,
@@ -330,6 +338,7 @@ function vv_rsync_status(): array {
'daily' => ($vars['DAILY_RSYNC_ENABLED'] ?? 'false') !== 'false',
'intermediate' => ($vars['INTERMEDIATE_RSYNC_ENABLED'] ?? 'true') !== 'false',
'weekly' => ($vars['WEEKLY_RSYNC_ENABLED'] ?? 'false') !== 'false',
'monthly' => ($vars['MONTHLY_RSYNC_ENABLED'] ?? 'true') !== 'false',
];
// Active rsync profiles — from lock files
@@ -353,10 +362,11 @@ function vv_rsync_status(): array {
'daily' => 'daily_sync_maintenance',
'intermediate' => 'intermediate_sync_maintenance',
'weekly' => 'weekly_sync_maintenance',
'monthly' => 'monthly_maintenance',
];
$lastSync = [];
foreach ($scriptMap as $key => $scriptName) {
$logFile = LOG_DIR . "/$scriptName.json";
$logFile = LOG_DIR . "/Orchestrators/$scriptName.json";
if (!file_exists($logFile)) continue;
$stat = json_decode(@file_get_contents($logFile) ?: '{}', true) ?: [];
$lastSync[$key] = [
@@ -376,7 +386,7 @@ function vv_rsync_status(): array {
$p = explode('|', $line);
if (count($p) < 4 || ($p[0] ?? '') < $cutoff7) continue;
$name = $p[2] ?? '';
if (!$name) continue;
if (!$name || str_ends_with($name, '-fallback')) continue;
if (!isset($profiles[$name])) $profiles[$name] = ['runs' => 0, 'dur' => 0, 'bytes' => 0];
$profiles[$name]['runs']++;
$profiles[$name]['dur'] += (int)($p[3] ?? 0);