Files
Varaverk/Plugin/unraid/api/monitor_remote.php
T
Gmer4Lfe b7894681e6 API key: use space separator, fix error-capture bug; add conf_sync and missing files from dev
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.
2026-06-04 16:17:47 -04:00

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;