Перейти к основному содержимому

🖥️ 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

FieldTypeRequiredDescription
agent_keystringUnique agent authentication key
cpu_usagefloatCPU usage percentage (0-100)
cpu_iowaitfloatCPU I/O wait percentage
memory_usagefloatMemory usage percentage (0-100)
memory_total_mbintegerTotal RAM in megabytes
swap_usagefloatSwap usage percentage
disk_usagearrayArray of disk mount points
disk_usage[].mountstringMount point path
disk_usage[].usagefloatUsage percentage
disk_usage[].sizestringTotal size (human-readable)
disk_usage[].usedstringUsed space
disk_usage[].availstringAvailable space
network_rx_bytesintegerNetwork bytes received
network_tx_bytesintegerNetwork bytes transmitted
load_1mfloat1-minute load average
load_5mfloat5-minute load average
load_15mfloat15-minute load average
osstringOperating system name
hostnamestringServer hostname
kernelstringKernel version

Response

{
"status": "ok"
}

Error Responses

Status CodeMeaning
422Invalid agent key or missing required fields
404Agent key not found

🔑 Finding Your Agent Key

  1. Create a Server Agent monitor in the dashboard
  2. The agent key is generated automatically
  3. View it in the monitor's detail page