mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
fix: update facts_collector for JARVIS VM (not DO web host)
- Site checks use external URLs instead of 127.0.0.1 loopback (JARVIS no longer shares a server with the websites) - JARVIS site URL updated to port 1972 - Fixed syntax error in DO server ping exec call - Removed Host header injection (not needed for external checks) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ foreach ($svcNames as $s) {
|
|||||||
|
|
||||||
// Site health from kb_facts
|
// Site health from kb_facts
|
||||||
$siteLabels = [
|
$siteLabels = [
|
||||||
"jarvis" => "jarvis.orbishosting.com",
|
"jarvis" => "jarvis.orbishosting.com:1972",
|
||||||
"tomsjavajive" => "tomsjavajive.com",
|
"tomsjavajive" => "tomsjavajive.com",
|
||||||
"epictravelexp"=> "epictravelexpeditions.com",
|
"epictravelexp"=> "epictravelexpeditions.com",
|
||||||
"parkersling" => "parkerslingshotrentals.com",
|
"parkersling" => "parkerslingshotrentals.com",
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ function collect_all(): array {
|
|||||||
|
|
||||||
// ── Digital Ocean ─────────────────────────────────────────────────────
|
// ── Digital Ocean ─────────────────────────────────────────────────────
|
||||||
try {
|
try {
|
||||||
exec("ping -c1 -W1 165.22.1.228 > /dev/null 2>&1", $o2, $doCode));
|
exec("ping -c1 -W1 165.22.1.228 > /dev/null 2>&1", $o2, $doCode);;
|
||||||
$doStatus = ($doCode === 0) ? 'online' : 'unreachable';
|
$doStatus = ($doCode === 0) ? 'online' : 'unreachable';
|
||||||
KBEngine::storeFact('do_server', 'do_status', $doStatus, '165.22.1.228', $ttl);
|
KBEngine::storeFact('do_server', 'do_status', $doStatus, '165.22.1.228', $ttl);
|
||||||
$results['do_server'] = "ok ({$doStatus})";
|
$results['do_server'] = "ok ({$doStatus})";
|
||||||
@@ -181,7 +181,7 @@ function collect_all(): array {
|
|||||||
$results['sites'] = 'skipped (fresh)';
|
$results['sites'] = 'skipped (fresh)';
|
||||||
} else try {
|
} else try {
|
||||||
$sites = [
|
$sites = [
|
||||||
'jarvis' => 'https://jarvis.orbishosting.com',
|
"jarvis" => "http://jarvis.orbishosting.com:1972",
|
||||||
'tomsjavajive' => 'https://tomsjavajive.com',
|
'tomsjavajive' => 'https://tomsjavajive.com',
|
||||||
'epictravelexp'=> 'https://epictravelexpeditions.com',
|
'epictravelexp'=> 'https://epictravelexpeditions.com',
|
||||||
'parkersling' => 'https://parkerslingshotrentals.com',
|
'parkersling' => 'https://parkerslingshotrentals.com',
|
||||||
@@ -195,7 +195,7 @@ function collect_all(): array {
|
|||||||
$host = $parsed['host'] ?? $url;
|
$host = $parsed['host'] ?? $url;
|
||||||
// Check sites on the local server directly to avoid Cloudflare CDN timeouts.
|
// Check sites on the local server directly to avoid Cloudflare CDN timeouts.
|
||||||
// All JARVIS-hosted sites are served from this same OLS instance.
|
// All JARVIS-hosted sites are served from this same OLS instance.
|
||||||
$localUrl = 'http://127.0.0.1' . ($parsed['path'] ?? '/');
|
$localUrl = $url; // external check
|
||||||
$ch = curl_init($localUrl);
|
$ch = curl_init($localUrl);
|
||||||
curl_setopt_array($ch, [
|
curl_setopt_array($ch, [
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
@@ -204,7 +204,6 @@ function collect_all(): array {
|
|||||||
CURLOPT_TIMEOUT => 10,
|
CURLOPT_TIMEOUT => 10,
|
||||||
CURLOPT_CONNECTTIMEOUT => 5,
|
CURLOPT_CONNECTTIMEOUT => 5,
|
||||||
CURLOPT_NOBODY => true,
|
CURLOPT_NOBODY => true,
|
||||||
CURLOPT_HTTPHEADER => ["Host: $host"],
|
|
||||||
]);
|
]);
|
||||||
curl_exec($ch);
|
curl_exec($ch);
|
||||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
|||||||
Reference in New Issue
Block a user