Files
html/api/wevia-master-autoheal.php
2026-04-16 02:28:32 +02:00

37 lines
2.1 KiB
PHP

<?php
header('Content-Type:application/json');
$log='/var/log/wevia-autoheal.log';
function tc($url,$payload,$name){
$ch=curl_init($url);curl_setopt_array($ch,[CURLOPT_POST=>1,CURLOPT_POSTFIELDS=>json_encode($payload),CURLOPT_HTTPHEADER=>['Content-Type:application/json'],CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>10,CURLOPT_SSL_VERIFYPEER=>0]);
$r=curl_exec($ch);$c=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);
return['name'=>$name,'code'=>$c,'ok'=>$c>=200&&$c<400&&strlen($r)>5,'size'=>strlen($r)];
}
function th($url,$name){
$ch=curl_init($url);curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>8,CURLOPT_SSL_VERIFYPEER=>0]);
$r=curl_exec($ch);$c=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);
return['name'=>$name,'code'=>$c,'ok'=>$c>=200&&$c<400,'size'=>strlen($r)];
}
$t=[
th('http://127.0.0.1:4000','WEVAL API'),
th('http://127.0.0.1:3000','MiroFish'),
th('http://127.0.0.1:11434/api/tags','Ollama'),
th('https://weval-consulting.com/wevads-ia/','WEVADS IA'),
th('https://weval-consulting.com/agents-archi.html','Agents Archi'),
th('https://weval-consulting.com/wevia-console.html','WEVIA Console'),
th('https://weval-consulting.com/value-streaming.html','Value Streaming'),
th('https://weval-consulting.com/paperclip.html','Paperclip'),
th('https://weval-consulting.com/register.html','Register'),
th('https://weval-consulting.com/api/ecosystem-health.php','Ecosystem API'),
th('https://weval-consulting.com/agents-fleet.html','Agents Fleet'),
th('https://weval-consulting.com/enterprise-model.html','Enterprise'),
th('https://weval-consulting.com/wevia-meeting-rooms.html','Meeting Rooms'),
th('https://weval-consulting.com/director-center.html','Director'),
th('https://weval-consulting.com/l99-brain.html','L99 Brain'),
];
$fails=array_filter($t,fn($s)=>!$s['ok']);
$ts=date('c');
file_put_contents($log,"[$ts] ".count($t)."T ".count($fails)."F ".implode(',',array_map(fn($f)=>$f['name'],array_values($fails)))."
",FILE_APPEND);
echo json_encode(['ts'=>$ts,'total'=>count($t),'pass'=>count($t)-count($fails),'fail'=>count($fails),'services'=>$t]);