Media Stack called every node local, and a host whose watchdogs never ran reported all clear
This commit is contained in:
@@ -310,8 +310,27 @@ function vv_watchdog_summary(): array {
|
||||
&& $rwLevel === 0 && $daemonStrikes === 0 && $oomCount === 0 && $reboots === 0
|
||||
&& $npmStrikes === 0 && $nicState === 'up' && $sshdOk;
|
||||
|
||||
// "No strikes" and "never ran" are not the same fact. Every strike file read above defaults an
|
||||
// absent file to zero, so a host where the watchdogs have never executed reports exactly like
|
||||
// one they just swept clean — a green card standing in for no information at all. HOST2 showed
|
||||
// that green for four days on a STATE_DIR holding no watchdog file whatsoever, because its
|
||||
// schedule.json never had the orchestrator enabled.
|
||||
//
|
||||
// $healthy stays a verdict about strikes; the caller is told separately whether there was
|
||||
// anything to form a verdict from.
|
||||
$lastRun = 0;
|
||||
foreach ([
|
||||
'watchdog_orch_hb.count', 'container_watchdog_state.db', 'resource_watchdog_state.db',
|
||||
'system_watchdog_state.db', 'storage_watchdog_state.db', 'network_watchdog_state.db',
|
||||
] as $f) {
|
||||
$p = STATE_DIR . '/' . $f;
|
||||
if (is_file($p)) $lastRun = max($lastRun, (int)@filemtime($p));
|
||||
}
|
||||
|
||||
return [
|
||||
'healthy' => $healthy,
|
||||
'last_run' => $lastRun ?: null,
|
||||
'never_ran' => $lastRun === 0,
|
||||
'ctr_strikes' => $ctrStrikes,
|
||||
'rw_level' => $rwLevel,
|
||||
'rw_paused' => array_values(array_filter(explode(',', $rw['rm_paused_containers'] ?? ''))),
|
||||
|
||||
Reference in New Issue
Block a user