๐ฅ๏ธ Server Agent API
Submit Server Metricsโ
Report server system metrics from an agent script.
Endpointโ
POST /agent/report
Headersโ
Content-Type: application/json
Accept: application/json
Request Bodyโ
{
"agent_key": "your-agent-key-here",
"cpu_usage": 23.5,
"cpu_iowait": 1.2,
"memory_usage": 67.4,
"memory_total_mb": 8192,
"swap_usage": 5.0,
"disk_usage": [
{
"mount": "/",
"usage": 45,
"size": "50G",
"used": "22G",
"avail": "28G"
}
],
"network_rx_bytes": 1234567890,
"network_tx_bytes": 987654321,
"load_1m": 0.5,
"load_5m": 0.3,
"load_15m": 0.2,
"os": "Ubuntu 24.04 LTS",
"hostname": "web-server-1",
"kernel": "6.5.0-44-generic"
}
Fieldsโ
| Field | Type | Required | Description |
|---|---|---|---|
agent_key | string | โ | Unique agent authentication key |
cpu_usage | float | โ | CPU usage percentage (0-100) |
cpu_iowait | float | โ | CPU I/O wait percentage |
memory_usage | float | โ | Memory usage percentage (0-100) |
memory_total_mb | integer | โ | Total RAM in megabytes |
swap_usage | float | โ | Swap usage percentage |
disk_usage | array | โ | Array of disk mount points |
disk_usage[].mount | string | โ | Mount point path |
disk_usage[].usage | float | โ | Usage percentage |
disk_usage[].size | string | โ | Total size (human-readable) |
disk_usage[].used | string | โ | Used space |
disk_usage[].avail | string | โ | Available space |
network_rx_bytes | integer | โ | Network bytes received |
network_tx_bytes | integer | โ | Network bytes transmitted |
load_1m | float | โ | 1-minute load average |
load_5m | float | โ | 5-minute load average |
load_15m | float | โ | 15-minute load average |
os | string | โ | Operating system name |
hostname | string | โ | Server hostname |
kernel | string | โ | Kernel version |
Responseโ
{
"status": "ok"
}
Error Responsesโ
| Status Code | Meaning |
|---|---|
422 | Invalid agent key or missing required fields |
404 | Agent key not found |
๐ Finding Your Agent Keyโ
- Create a Server Agent monitor in the dashboard
- The agent key is generated automatically
- View it in the monitor's detail page