chore: add system metrics

This commit is contained in:
d3m0k1d
2026-04-05 05:37:19 +03:00
parent 54e8102a51
commit c2e8037560
13 changed files with 812 additions and 47 deletions
+68
View File
@@ -166,6 +166,37 @@
}
}
},
"/agents/system-metrics": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "Returns CPU, RAM, disk, and network usage metrics for all connected agents",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"agents"
],
"summary": "Get agent system metrics",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_handlers.AgentSystemMetricsOut"
}
}
}
}
}
},
"/auth/login": {
"post": {
"description": "Authenticate with login and password, returns a token and permissions",
@@ -2695,6 +2726,43 @@
}
}
},
"internal_handlers.AgentSystemMetricsOut": {
"type": "object",
"properties": {
"connected_at": {
"type": "string",
"example": "2026-04-04 10:30:00"
},
"cpu_percent": {
"type": "number",
"example": 45.2
},
"disk_percent": {
"type": "number",
"example": 78.9
},
"id": {
"type": "string",
"example": "agent-001"
},
"label": {
"type": "string",
"example": "web-server-1"
},
"memory_percent": {
"type": "number",
"example": 62.5
},
"network_rx_bytes": {
"type": "number",
"example": 1048576
},
"network_tx_bytes": {
"type": "number",
"example": 524288
}
}
},
"internal_handlers.CheckCmdIn": {
"type": "object",
"required": [