37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
|
|
// Check which endpoints need auth
|
|
$endpoints = [
|
|
"/api/wevia-master-api.php",
|
|
"/api/wevia-autonomous.php",
|
|
"/api/ambre-multiagent-parallel.php",
|
|
"/api/ambre-session-chat.php",
|
|
"/api/ambre-tool-pdf-premium.php",
|
|
"/api/ambre-tool-mermaid.php",
|
|
"/api/ambre-tool-web-search.php",
|
|
"/api/wevia-safe-write.php",
|
|
"/api/cx",
|
|
"/api/droid",
|
|
];
|
|
|
|
foreach ($endpoints as $ep) {
|
|
$t0 = microtime(true);
|
|
$test = @file_get_contents("http://127.0.0.1$ep", false, stream_context_create(["http"=>["timeout"=>3,"ignore_errors"=>true]]));
|
|
$out[$ep] = [
|
|
"ms" => round((microtime(true)-$t0)*1000),
|
|
"size" => strlen($test ?: ""),
|
|
"first_50" => substr($test ?: "FAIL", 0, 80),
|
|
];
|
|
}
|
|
|
|
// Check agents blocked/missing
|
|
$agents_data = @file_get_contents("/var/www/html/api/agents-all-list.json") ?: @file_get_contents("/var/www/html/api/agents.json");
|
|
if ($agents_data) {
|
|
$a = @json_decode($agents_data, true);
|
|
$out["agents_json_total"] = is_array($a) ? count($a) : 0;
|
|
}
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|