14 lines
817 B
PHP
14 lines
817 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$r=[];
|
|
$nr=@json_decode(@file_get_contents("http://127.0.0.1/api/nonreg-api.php?cat=all"),true);
|
|
$r[]="NONREG: ".($nr["pass"]??"?")."/".($nr["total"]??"?");
|
|
$l99=@json_decode(@file_get_contents("http://127.0.0.1/api/l99-api.php?action=stats"),true);
|
|
$r[]="L99: ".($l99["pass"]??"?")."/".($l99["total"]??"?")." (".($l99["score"]??"?")."%)";
|
|
$r[]="LOAD: ".trim(@shell_exec("cat /proc/loadavg"));
|
|
$r[]="DISK: ".trim(@shell_exec("df -h / | tail -1"));
|
|
$r[]="DOCKER: ".trim(@shell_exec("docker ps -q 2>/dev/null | wc -l"))." containers";
|
|
$r[]="GIT: ".trim(@shell_exec("cd /var/www/html && git status -s|wc -l"))." dirty";
|
|
$r[]="CRONS: ".trim(@shell_exec("crontab -l 2>/dev/null|grep -cv '^#'"))." active";
|
|
echo json_encode(["diagnostic"=>implode("\n",$r),"ts"=>date("c")]);
|