The Dashboard API provides read-only access to live monitoring data from the connected OpenWrt router. Every endpoint establishes an SSH session on request using the credentials configured in your environment, executes one or more shell commands on the router, and returns the output as JSON. No request body or query parameters are required for any of these endpoints.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KevinCruz-cell/Redes-de-comunicaciones-/llms.txt
Use this file to discover all available pages before exploring further.
All endpoints require an active router session. If the SSH connection fails — for example, because the router is unreachable or credentials are wrong — every endpoint returns HTTP 500 with
{ "status": "error", "message": "..." }. See the authentication guide for session setup.GET /api/dashboard/data
Returns a comprehensive snapshot of the router’s system state. Internally callsSystemRouterService::getSystemInfo(), which collects hostname, current time, uptime, load averages, memory, CPU model, network interfaces, and kernel version over SSH.
Request parameters
No parameters.Response schema
Result of the operation. Either
"success" or "error".System information object collected from the router.
Example
- Request
- Success response
- Error response
GET /api/dashboard/realtime
Returns live system metrics gathered from the router in a single SSH session burst. Use this endpoint for polling dashboards that display current CPU load, memory consumption, and network connection counts. Shell commands executed:| Field | Command |
|---|---|
cpu | top -bn1 | grep 'Cpu(s)' | awk '{print $2}' | cut -d'%' -f1 |
memory | free -m | grep Mem | awk '{print $3}' |
memory_total | free -m | grep Mem | awk '{print $2}' |
load | cat /proc/loadavg | cut -d' ' -f1-3 |
connections | netstat -an | grep ESTABLISHED | wc -l |
uptime | cat /proc/uptime | awk '{print int($1/3600)"h "int(($1%3600)/60)"m"}' |
Request parameters
No parameters.Response schema
"success" or "error".Live metrics object.
Example
- Request
- Success response
- Error response
GET /api/dashboard/firewall
Returns the active iptables ruleset from the router. Executesiptables -L -n -v | head -100 and returns the raw text output, capped at 100 lines.
Request parameters
No parameters.Response schema
"success" or "error".Raw output of
iptables -L -n -v | head -100. Contains chain headers, column labels, and one rule per line.Example
- Request
- Success response
- Error response
GET /api/dashboard/routes
Returns the kernel routing table of the router. Executesip route show over SSH and returns its raw output.
Request parameters
No parameters.Response schema
"success" or "error".Raw output of
ip route show. Each line represents one routing entry.Example
- Request
- Success response
- Error response
GET /api/dashboard/syslog
Returns the last 100 entries from the router’s system log. Executeslogread | tail -100 via SSH. On OpenWrt, logread reads from the in-memory ring buffer maintained by the logd daemon.
Request parameters
No parameters.Response schema
"success" or "error".Raw syslog output — up to 100 lines, each prefixed with a timestamp and facility tag.
Example
- Request
- Success response
- Error response
GET /api/dashboard/kernel
Returns the last 100 kernel log messages from the router. Executesdmesg | tail -100 via SSH.
Request parameters
No parameters.Response schema
"success" or "error".Raw
dmesg output — up to 100 lines of kernel ring buffer messages.Example
- Request
- Success response
- Error response
GET /api/dashboard/processes
Returns the list of running processes on the router. Executesps aux | head -100 via SSH, returning up to 100 process entries.
Request parameters
No parameters.Response schema
"success" or "error".Raw
ps aux output — a header line followed by one process per line, capped at 100 lines.Example
- Request
- Success response
- Error response
Error handling
All Dashboard API endpoints share the same error contract. When an SSH connection cannot be established or a remote command fails, the endpoint returns HTTP500 with the following body:
- Wrong credentials — check
ROUTER_IP,ROUTER_USER, andROUTER_PASSWORDin your.envfile. - Router unreachable — verify network connectivity from the web server to
ROUTER_IP:ROUTER_PORT. - SSH daemon not running — on OpenWrt, ensure
dropbearis active:service dropbear status.