"; $context = stream_context_create([ 'http' => [ 'timeout' => 5, 'header' => "User-Agent: PHP/" . PHP_VERSION . "\r\n" ] ]); $json = @file_get_contents($apiUrl, false, $context); if ($json === false) { die('

Could not fetch data from the API.

'); } $clients = json_decode($json, true); if ($clients === null || !is_array($clients)) { die('

Malformed JSON returned from the API.

'); } // hostname get handler $selectedId = $_GET['host'] ?? ''; // the value passed in ?host= $selectedIdx = null; foreach ($clients as $idx => $client) { if (isset($client['short_id']) && $client['short_id'] === $selectedId) { $selectedIdx = $idx; break; } } if ($selectedIdx === null) { // No match – fall back to the first client (or none) $selectedIdx = 0; $selectedId = $clients[$selectedIdx]['short_id'] ?? ''; } $client = $clients[$selectedIdx] ?? null; $properties = $client['client_properties'][0] ?? []; $systemProperties = $properties['system_properties'] ?? []; $systemComponents = $properties['system_components'] ?? []; $selectedHost = $clients[$selectedIdx]['hostname']; ?> Cosmostat - <?= h($selectedHost) ?>

Matt-Cloud Cosmostat Dashboard

This dashboard shows the local Matt-Cloud system stats.

Component Desriptor

To view the component descriptor, you may
curl -s https:///descriptor

This will return the entire JSON descriptor variable.
The endpoint agent uses this descriptor to build out its local System Object.
The agent then reports back to the Cosmostat Server with all the data found in the descriptor.
Full Source Code can be found at its Gitea page.

System Properties

Live System Metrics

Connecting...

Components