在目標主機安裝 Agent 後,Agent 會每 5 分鐘自動推送系統報告到本平台。
適用於無法對外開放 API 的主機(DB、檔案伺服器、內部 IP 等)。
@if ($host->agent_token)
@if ($host->agent_last_report_at)
最後回報:{{ $host->agent_last_report_at->diffForHumans() }}
@else
尚未收到任何回報
@endif
@php
$installerUrl = url("/api/agent/installer/{$host->agent_token}");
$isWin = ($host->os_type ?? 'linux') === 'windows';
$installCmdVal = $isWin
? 'iex (New-Object Net.WebClient).DownloadString("' . $installerUrl . '")'
: 'bash <(curl -fsSL "' . $installerUrl . '")';
$installNote = $isWin
? '以系統管理員開啟 PowerShell 執行(需 PowerShell 5.1+)'
: '在目標主機以 root 執行此指令即可安裝並啟動 Agent';
@endphp
{!! $isWin ? '🪟 PS' : '🐧 SH' !!}
{{ $installNote }}
@if($isWin)
若出現執行原則限制,請先執行:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
@endif
@endif
@if ($host->agent_token)
@endif