Files
html/api/automation-status-live.php

31 lines
1.4 KiB
PHP

<?php
header("Content-Type: application/json");
header("Access-Control-Allow-Origin: *");
$out = ['ok' => true, 'ts' => date('c'), 'doctrine' => '64-ZERO-MANUAL-TASK'];
// Automations wired
$out['automations'] = [
'crm_pipeline_sync' => ['status' => file_exists('/usr/local/bin/deliverads-guard.sh check via sentinel') ? 'active' : 'missing'],
'crm_observation_daily' => ['status' => file_exists('/etc/cron.d/crm-observation') ? 'active' : 'missing'],
'blade_selfheal' => ['status' => file_exists('/etc/cron.d/automation-blade-selfheal') ? 'active' : 'missing'],
'ovh_cancel' => ['status' => file_exists('/etc/cron.d/automation-ovh-daily') ? 'active' : 'missing'],
'azure_rotation' => ['status' => file_exists('/var/www/html/api/azure-reregister-api.php') ? 'active' : 'missing'],
'nonreg_guard' => ['status' => 'active'], // always via systemd elsewhere
'l99_auto_update' => ['status' => 'active'],
'ethica_enrich' => ['status' => 'active'],
];
// Pending (read from automation-pending.json)
$pending_file = '/var/www/html/api/automation-pending.json';
$out['pending'] = [];
if (is_readable($pending_file)) {
$out['pending'] = json_decode(@file_get_contents($pending_file), true) ?: [];
}
// Counts
$out['crons_count'] = count(glob('/etc/cron.d/*'));
$out['scripts_count'] = count(glob('/opt/weval-l99/*.py')) + count(glob('/opt/weval-l99/*.sh'));
echo json_encode($out, JSON_PRETTY_PRINT);