# GeoNetAgent — IT Asset Monitoring & CMDB Portal IT + CMDB ringan yang melengkapi Zabbix. Mengumpulkan data hardware/software dari endpoint Windows via PowerShell agent, menyimpannya ke PostgreSQL melalui FastAPI collector, dan menampilkannya di portal Laravel. > **AI Agent & Developer baru:** Mulai dari [`docs/context-index.md`](docs/context-index.md) — peta navigasi seluruh dokumentasi. --- ## Komponen | Komponen | Stack | Lokasi | URL Produksi | |----------|-------|--------|--------------| | **PowerShell Agent** | PS 5.1+ | `agent/` | Install: `agent.gisportal.id/install/` | | **FastAPI Collector** | Python 3.11 + FastAPI | `collector/` | `collector.gisportal.id` | | **Infrastruktur** | Nginx, Docker, DB migrations | `infra/` | - | | **Laravel Portal** | Laravel (belum scaffold) | `portal/` (planned) | `portal.geonet.internal` | --- ## Quick Start — Install Agent (User) Jalankan PowerShell sebagai **Administrator**, dua baris berurutan: ```powershell Invoke-WebRequest -Uri 'https://agent.gisportal.id/install/GeoNetAgent-Install.ps1' -OutFile "$env:TEMP\GeoNetAgent-Install.ps1" -UseBasicParsing & "$env:TEMP\GeoNetAgent-Install.ps1" ``` Untuk update: perintah yang sama. `config.json` lokal dipertahankan. --- ## Quick Start — Developer ```bash cd collector cp ../.env.example .env # Edit .env — isi DATABASE_URL dan AGENT_BEARER_TOKEN pip install -e ".[dev]" uvicorn app.main:app --reload --port 8000 ``` --- ## Deploy (Admin IT) ```powershell # Publish agent ke server (setelah bump versi) .\infra\collector\publish_agent_install.ps1 # Deploy collector (FastAPI) .\infra\collector\push_collector.ps1 # Deploy nginx config bash infra/collector/deploy_nginx.sh ``` --- ## Status Proyek | Fase | Status | Keterangan | |------|--------|------------| | Fase 0 — Blueprint | ✅ Selesai | Dokumentasi + scaffold | | Fase 1 — Foundation | 🔄 Aktif (8/9) | Agent E2E → DB → UI read-only · Blocker: Laravel asset index | | Fase 2 — Zabbix | ⏳ Pending | Webhook alert + host status | | Fase 3 — CMDB Lengkap | ⏳ Pending | Proxmox sync, license, dokumen QNAP | | Fase 4 — Scale | ⏳ Pending | GPO, trend, Ollama | Agent versi saat ini: **v0.1.10-phase0** --- ## Struktur Monorepo ``` GeoNetAgent/ ├── agent/ — PowerShell agent (install ke endpoint user) │ ├── lib/ — Modul collect: CPU, disk, RAM, GPU, network, software, peripherals │ ├── gpo/ — Script GPO untuk rollout massal │ └── install/ — Entry point web install ├── collector/ — FastAPI service (terima laporan agent, read API) │ ├── app/ — Source FastAPI │ └── docs/API.md — API documentation ├── infra/ — Nginx, DB migrations, Docker, QNAP config │ ├── collector/ — Deploy scripts │ ├── db/ — SQL migrations │ ├── nginx/ — Nginx config │ └── qnap/ — QNAP Object Storage config ├── samples/ — Sample payload & DXDiag untuk testing ├── docs/ — Dokumentasi lengkap ⭐ └── .cursor/ — AI context (blueprint, schema, API, progress) ``` --- ## Dokumentasi Lengkap Lihat [`docs/context-index.md`](docs/context-index.md) untuk peta dokumentasi. | Topik | File | |-------|------| | Status & progress | `docs/project-status.md` | | Arsitektur sistem | `docs/architecture/system-overview.md` | | API Collector | `docs/api/service-collector.md` | | Database schema | `docs/database.md` | | Deploy guide | `docs/deployment.md` | | Environment vars | `docs/environment.md` | | Troubleshooting | `docs/troubleshooting.md` | | ADR | `docs/adr/` | --- ## ADR (Architecture Decision Records) | ADR | Keputusan | |-----|-----------| | [ADR-001](docs/adr/ADR-001-agent-asset-identity.md) | Strategi identitas asset (serial → smbios_uuid → MAC) | | [ADR-002](docs/adr/ADR-002-asset-split-by-hardware.md) | Split asset dengan hardware campur | | [ADR-003](docs/adr/ADR-003-asset-documents-qnap.md) | Dokumen procurement di QNAP Object Storage |