9 lines
590 B
PHP
9 lines
590 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$w = intval(trim(shell_exec("pgrep -c php-fpm 2>/dev/null")));
|
|
$act = "none";
|
|
if($w > 50) { shell_exec("killall -9 php-fpm8.5; sleep 2; systemctl start php8.5-fpm &"); $act = "RESTART_$w"; }
|
|
$pages = ["tools-hub.html","apps.html","enterprise-model.html","agents-archi.html","nonreg.html"];
|
|
$miss = []; foreach($pages as $p) if(!file_exists("/var/www/html/$p")) $miss[] = $p;
|
|
echo json_encode(["ok"=>$w<50&&empty($miss),"workers"=>$w,"pages"=>count($pages)-count($miss)."/".count($pages),"missing"=>$miss,"action"=>$act,"ts"=>date("H:i:s")]);
|