unRAID API rejects underscores and hyphens in key names — only letters, numbers, and spaces allowed. Varaverk_HOST1 / Varaverk_Gmer4Lfe both fail; now uses "Varaverk <hostname>" (space). Also adds monitor_remote.php, conf_populate.sh, and conf_sync.sh from dev branch that were missing from production.
21 lines
528 B
PHP
21 lines
528 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
header('Cache-Control: no-cache, no-store');
|
|
require_once dirname(__DIR__) . '/include/monitor.php';
|
|
|
|
$cacheFile = '/tmp/vv_cache_monitor_remote.json';
|
|
$cacheTTL = 3600;
|
|
|
|
if (!isset($_GET['live']) && file_exists($cacheFile) && (time() - filemtime($cacheFile)) < $cacheTTL) {
|
|
echo file_get_contents($cacheFile);
|
|
exit;
|
|
}
|
|
|
|
$out = json_encode([
|
|
'remote_hosts' => vv_remote_hosts_stats(),
|
|
'ts' => time(),
|
|
]);
|
|
|
|
file_put_contents($cacheFile, $out);
|
|
echo $out;
|