-
Notifications
You must be signed in to change notification settings - Fork 2
API Reference
The Rust backend exposes a small HTTP API (served by Axum) that the frontend polls every 2 seconds.
| Endpoint | Method | Description |
|---|---|---|
GET / |
GET | Serves the self-contained view.html dashboard |
GET /health |
GET | Returns server status, version, and uptime |
GET /config |
GET | Returns server config |
GET /screenshot |
GET | Returns a JSON array of base64-encoded PNG screen captures |
GET /root_pids |
GET | Returns a list of PIDs being tracked |
GET /process/<PID> |
GET | Returns root process info, child processes, CPU/memory stats, and work_done flag |
GET /process/root/<PID> |
GET | Returns only the root process snapshot, or 404 if it has exited |
GET /process/children/<PID> |
GET | Returns snapshots of all currently live child processes |
GET /process/status/<PID> |
GET | Lightweight summary — root alive/dead, child count, and work_done flag |
GET /top-processes |
GET | Returns the top N processes sorted by the given key |
GET /system |
GET | Returns the full system snapshot (CPU, memory, disks, network, battery, thermals, health) |
GET /cpu |
GET | Returns the current CPU snapshot only |
GET /memory |
GET | Returns the current memory snapshot only |
GET /disks |
GET | Returns per-disk snapshots |
GET /networks |
GET | Returns per-network-interface snapshots |
GET /gpus |
GET | Returns GPU snapshots (empty if no supported GPU detected) |
GET /battery |
GET | Returns the battery snapshot, or 404 if no battery present |
GET /host-info |
GET | Returns static host information (hostname, OS, kernel, arch, uptime) |
GET /temperatures |
GET | Returns thermal sensor readings |
GET /systemd |
GET | Returns the full systemd snapshot (units, counts) — Linux only |
GET /unit/<unit_name> |
GET | Returns a snapshot for a specific unit by name, or 404 if not found |
GET /units/<unit_state> |
GET | Returns all units matching the given active state |
GET /failed_units |
GET | Returns all units currently in a failed state |
POST /shutdown |
POST | Gracefully shuts down the server |
{
"screens": [
{
"mime": "image/png",
"data": "<base64>",
"monitor_name": "Built-in Display",
"monitor_id": 0,
"width": 1920,
"height": 1080,
"timestamp": "2025-01-01T00:00:00Z"
}
],
"count": 1
}[123, 12345]{
"work_done": false,
"root": {
"name": "my-app",
"pid": 1234,
"state": "running",
"cpu_usage": 12.5,
"memory_human": "128 MB"
},
"child_count": 2,
"children": [...],
"timestamp": "2025-01-01T00:00:00Z"
}Process state can be running, sleeping, gone, or any other string (rendered as a warning-colored pill).
Returns a single ProcessInfo object, or 404 if the root process has exited.
{
"root_alive": true,
"root_pid": 1234,
"root_name": "my-app",
"child_count": 2,
"work_done": false,
"timestamp": "2025-01-01T00:00:00Z"
}{
"status": "healthy",
"timestamp": "2025-01-01T00:00:00Z",
"version": "0.1.0",
"uptime": "3600s"
}{
"blind": false,
"pid": [],
"top_processes": false,
"limit_processes": 5,
"telegram_bot": false,
"system_resources": false
}[
{
"name": "my-app",
"pid": 1234,
"state": "running",
"cpu_usage": 12.5,
"memory_human": "128 MB"
}
]health can be healthy, warning, or critical. Individual sub-endpoints (/cpu, /memory, /disks, /networks, /gpus, /battery, /host-info, /temperatures) return their respective nested objects directly.
Note: On Windows, the
/temperaturesendpoint requires running the app as administrator.
{
"timestamp": "2025-01-01T00:00:00Z",
"health": "healthy",
"cpu": {
"usage_percent": 14.2,
"brand": "Intel(R) Core(TM) i9-13900K",
"frequency_mhz": 3200,
"physical_core_count": 24,
"cores": [{ "name": "cpu0", "usage_percent": 12.1, "frequency_mhz": 3200 }],
"load_avg": { "one": 0.45, "five": 0.60, "fifteen": 0.72 }
},
"memory": {
"total_bytes": 34359738368,
"used_bytes": 12884901888,
"available_bytes": 21474836480,
"free_bytes": 18253611008,
"used_percent": 37.5,
"swap_total_bytes": 4294967296,
"swap_used_bytes": 0,
"swap_free_bytes": 4294967296,
"swap_used_percent": 0.0
},
"disks": [
{
"name": "/dev/sda1",
"mount_point": "/",
"file_system": "ext4",
"kind": "Ssd",
"is_removable": false,
"total_bytes": 500107862016,
"used_bytes": 120259084288,
"available_bytes": 379848777728,
"used_percent": 24.0
}
],
"networks": [
{
"interface": "eth0",
"rx_bytes_per_sec": 2048,
"tx_bytes_per_sec": 512,
"rx_total_bytes": 1073741824,
"tx_total_bytes": 536870912,
"rx_packets_per_sec": 4,
"tx_packets_per_sec": 2,
"rx_errors": 0,
"tx_errors": 0
}
],
"gpus": [],
"battery": null,
"temperatures": [
{
"label": "coretemp Package id 0",
"temperature_celsius": 52.0,
"temperature_max_celsius": 71.0,
"temperature_critical_celsius": 100.0
}
],
"host": {
"hostname": "my-machine",
"os_name": "Ubuntu 24.04.1 LTS",
"kernel_version": "6.8.0-40-generic",
"cpu_arch": "x86_64",
"uptime_secs": 86400,
"process_count": 312
}
}Linux only. Returns
404on non-Linux platforms.
{
"timestamp": "2025-01-01T00:00:00Z",
"units": [
{
"unit_name": "nginx.service",
"unit_type": "service",
"load_state": "loaded",
"active_state": "active",
"sub_state": "running",
"description": "A high performance web server and a reverse proxy server",
"main_pid": 1234,
"memory_bytes": 10485760,
"cpu_usage_ns": 500000000,
"restart_count": 0,
"since": "2025-01-01T00:00:00Z",
"fragment_path": "/lib/systemd/system/nginx.service"
}
],
"failed_count": 0,
"active_count": 42,
"inactive_count": 10
}unit_type can be service, socket, target, timer, mount, device, or other.
load_state can be loaded, not_found, bad_setting, error, or masked.
Returns a single UnitSnapshot object (same shape as array elements above), or 404 if not found.
Returns an array of UnitSnapshot objects matching the given active_state. Valid states: active, reloading, inactive, failed, activating, deactivating.
Returns an array of UnitSnapshot objects whose active_state is failed.