Watchdog and Monitor looked the partner up by exact key, and the remote probe passed a quote to cut as a filename
This commit is contained in:
@@ -366,8 +366,12 @@ function vv_wd_remote_data(string $ip, string $sshKey, string $restartLogPath):
|
||||
. 'sf="$sd/data/state"; [ -d "$sf" ] || sf="$sd/State_Files"; '
|
||||
. 'db="$sd/data/db"; [ -d "$db" ] || db="$sd/data"; '
|
||||
. "printf 'UPTIME:%s\nLOAD:%s\nCORES:%s\nDAEMON:%s\nOOM:%s\nBASELINECOUNT:%s\nBASELINEAGE:%s\n---MEMINFO---\n%s\n---RW---\n%s\n---DOCK---\n%s\n---SKIP---\n%s\n---SYS---\n%s\n---REBOOT---\n%s\n---RESTART---\n%s\n---STORAGE---\n%s\n---NETWORK---\n%s\n' "
|
||||
. '"$(cat /proc/uptime|cut -d\" \" -f1)" '
|
||||
. '"$(cat /proc/loadavg|cut -d\" \" -f1)" '
|
||||
// awk, not `cut -d" "`. This is a PHP SINGLE-quoted string, which does not process \" —
|
||||
// so the shell received a literal backslash-quote, cut read the quote as a FILENAME
|
||||
// ("cut: '\"': No such file or directory"), and UPTIME and LOAD came back empty while every
|
||||
// quote-free field beside them parsed fine. awk needs no delimiter argument at all.
|
||||
. '"$(awk \'{print $1}\' /proc/uptime)" '
|
||||
. '"$(awk \'{print $1}\' /proc/loadavg)" '
|
||||
. '"$(nproc)" '
|
||||
. '"$(docker info >/dev/null 2>&1 && echo ok || echo err)" '
|
||||
. '"$(cat "$sf/system_watchdog_oom.db" 2>/dev/null||echo 0)" '
|
||||
@@ -550,8 +554,11 @@ function vv_wd_all(): array {
|
||||
$nodes = [];
|
||||
foreach ($hosts as $slot => $hostname) {
|
||||
$isMe = ($slot === $currentHost || $currentHost === 'unknown');
|
||||
$tsLabel = strtolower($hostname);
|
||||
$ts = $tsPeers[$tsLabel] ?? ['online' => null, 'active' => false, 'ip' => null];
|
||||
// Exact-key only, until now — the third copy of that lookup in this codebase and the
|
||||
// third to render a live partner as dark. This mesh's conf name and tailnet name differ
|
||||
// by one character, so HOST2 missed every time and its whole card read UNREACHABLE /
|
||||
// "No data" while HOST2's own page showed the same watchdogs reporting OK.
|
||||
$ts = vv_pt_peer_lookup($tsPeers, $hostname);
|
||||
$ip = $ts['ip'] ?? null;
|
||||
$raw = vv_read_conf_raw($slot . '.conf');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user