17 lines
1023 B
PHP
17 lines
1023 B
PHP
<?php
|
|
header("Content-Type:application/json");
|
|
$r=[];
|
|
$nr=json_decode(@file_get_contents("/var/www/html/api/l99-state.json"),true);
|
|
$r['l99']=($nr['pass']??0).'/'.($nr['total']??0);
|
|
$r['docker']=intval(trim(shell_exec("docker ps -q|wc -l")));
|
|
$r['disk']=intval(trim(shell_exec("df / --output=pcent|tail -1|tr -d ' %'")));
|
|
$r['hubs']=intval(trim(shell_exec("ls /var/www/html/*-hub.html|wc -l")));
|
|
$r['skills']=intval(trim(shell_exec("ls /var/www/html/api/skill-*.php|wc -l")));
|
|
$r['crons']=intval(trim(shell_exec("crontab -l 2>/dev/null|grep -v '^#'|wc -l")));
|
|
$r['dirty']=intval(trim(shell_exec("cd /var/www/html && git status --porcelain|wc -l")));
|
|
$r['pages']=intval(trim(shell_exec("find /var/www/html -maxdepth 1 -name '*.html'|wc -l")));
|
|
$nrf=json_decode(@file_get_contents("/var/www/html/api/nonreg-latest.json"),true);
|
|
$r['nonreg']=($nrf['pass']??'?').'/'.($nrf['total']??'?');
|
|
$r['todo']=['PAT GitHub expire J-2','Ethica specialty gaps 14','Phase 5 fine-tuning 5731 pairs'];
|
|
echo json_encode($r,JSON_PRETTY_PRINT);
|