feat: add node agent system with heartbeat collection, installer generation, and traffic flow telemetry
Add NodeAgent and TrafficFlow models to track agent status and network flows, implement /agents/heartbeat endpoint to receive interface counters, conntrack flows, firewall status, and nftables ruleset hash from agents, add nexafabric-agent.py Python script to collect host telemetry including VM/LXC interface hints via tap/fwbr regex matching, conntrack flow parsing with protocol/state/byte counters, and pve-firewall status checks,
This commit is contained in:
@@ -181,6 +181,34 @@ class NodeRead(OrmModel):
|
||||
memory_mb: int
|
||||
|
||||
|
||||
class NodeAgentRead(BaseModel):
|
||||
node_id: str
|
||||
status: str
|
||||
version: str | None = None
|
||||
last_seen_at: datetime | None = None
|
||||
install_count: int = 0
|
||||
last_payload: dict[str, Any] | None = None
|
||||
|
||||
|
||||
class NodeWithAgentRead(NodeRead):
|
||||
agent: NodeAgentRead | None = None
|
||||
|
||||
|
||||
class AgentHeartbeat(BaseModel):
|
||||
version: str
|
||||
node_name: str | None = None
|
||||
collected_at: datetime | None = None
|
||||
hostname: str | None = None
|
||||
kernel: str | None = None
|
||||
uptime_seconds: float | None = None
|
||||
loadavg: list[float] = []
|
||||
interfaces: list[dict[str, Any]] = []
|
||||
flows: list[dict[str, Any]] = []
|
||||
conntrack: dict[str, Any] = {}
|
||||
firewall: dict[str, Any] = {}
|
||||
extra: dict[str, Any] = {}
|
||||
|
||||
|
||||
class WorkloadRead(OrmModel):
|
||||
id: str
|
||||
cluster_id: str
|
||||
|
||||
Reference in New Issue
Block a user