HTTP API Reference

Use these endpoints to retrieve the latest collected CPU and RAM metrics programmatically.

GET /api/metrics

Returns the most recently collected CPU and RAM metrics in JSON format.

Response fields: cpu_percent, ram_used_mb, ram_available_mb, ram_total_mb, ram_percent, collected_at, collection_status

GET /api/metrics HTTP/1.1 Host: <gateway-ip>:<port> // Example response: { "cpu_percent": 12.4, "cpu_cores": 4, "ram_used_mb": 312, "ram_available_mb": 712, "ram_total_mb": 1024, "ram_percent": 30.5, "collected_at": "2024-01-01T12:00:00Z", "collection_status": "ok" }

Example response: { "cpu_percent": 12.4, "ram_used_mb": 312, "ram_available_mb": 712, "ram_total_mb": 1024, "ram_percent": 30.5, "collected_at": "2024-01-01T12:00:00Z", "collection_status": "ok" }

200 OK 503 Service Unavailable

GET /api/health

Returns the operational status of the monitor process including last collection and forwarding outcomes.

Response fields: status, last_collection_at, last_collection_status, last_forward_at, last_forward_status

GET /api/health HTTP/1.1 Host: <gateway-ip>:<port> // Example response: { "status": "ok", "last_collection_at": "2024-01-01T12:00:00Z", "last_collection_status": "ok", "last_forward_at": "2024-01-01T12:00:00Z", "last_forward_status": "success" }

Base URL: http://<gateway-ip>:<port>

No authentication is required to access these endpoints.

← Go to Dashboard