Skip to main content

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.

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.
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 calls SystemRouterService::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

status
string
required
Result of the operation. Either "success" or "error".
data
object
required
System information object collected from the router.

Example

curl -X GET http://your-app.test/api/dashboard/data \
  -H "Accept: application/json"

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:
FieldCommand
cputop -bn1 | grep 'Cpu(s)' | awk '{print $2}' | cut -d'%' -f1
memoryfree -m | grep Mem | awk '{print $3}'
memory_totalfree -m | grep Mem | awk '{print $2}'
loadcat /proc/loadavg | cut -d' ' -f1-3
connectionsnetstat -an | grep ESTABLISHED | wc -l
uptimecat /proc/uptime | awk '{print int($1/3600)"h "int(($1%3600)/60)"m"}'

Request parameters

No parameters.

Response schema

status
string
required
"success" or "error".
data
object
required
Live metrics object.

Example

curl -X GET http://your-app.test/api/dashboard/realtime \
  -H "Accept: application/json"

GET /api/dashboard/firewall

Returns the active iptables ruleset from the router. Executes iptables -L -n -v | head -100 and returns the raw text output, capped at 100 lines.

Request parameters

No parameters.

Response schema

status
string
required
"success" or "error".
data
string
required
Raw output of iptables -L -n -v | head -100. Contains chain headers, column labels, and one rule per line.

Example

curl -X GET http://your-app.test/api/dashboard/firewall \
  -H "Accept: application/json"

GET /api/dashboard/routes

Returns the kernel routing table of the router. Executes ip route show over SSH and returns its raw output.

Request parameters

No parameters.

Response schema

status
string
required
"success" or "error".
data
string
required
Raw output of ip route show. Each line represents one routing entry.

Example

curl -X GET http://your-app.test/api/dashboard/routes \
  -H "Accept: application/json"

GET /api/dashboard/syslog

Returns the last 100 entries from the router’s system log. Executes logread | 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

status
string
required
"success" or "error".
data
string
required
Raw syslog output — up to 100 lines, each prefixed with a timestamp and facility tag.

Example

curl -X GET http://your-app.test/api/dashboard/syslog \
  -H "Accept: application/json"

GET /api/dashboard/kernel

Returns the last 100 kernel log messages from the router. Executes dmesg | tail -100 via SSH.

Request parameters

No parameters.

Response schema

status
string
required
"success" or "error".
data
string
required
Raw dmesg output — up to 100 lines of kernel ring buffer messages.

Example

curl -X GET http://your-app.test/api/dashboard/kernel \
  -H "Accept: application/json"

GET /api/dashboard/processes

Returns the list of running processes on the router. Executes ps aux | head -100 via SSH, returning up to 100 process entries.

Request parameters

No parameters.

Response schema

status
string
required
"success" or "error".
data
string
required
Raw ps aux output — a header line followed by one process per line, capped at 100 lines.

Example

curl -X GET http://your-app.test/api/dashboard/processes \
  -H "Accept: application/json"

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 HTTP 500 with the following body:
{
  "status": "error",
  "message": "No se pudo conectar por SSH al router. Revisa usuario o contrasena."
}
Each endpoint opens a new SSH connection. If the router is under load or has connection limits set, rapid successive calls to multiple endpoints may be throttled or refused. Space out polling intervals accordingly — 5 seconds is a reasonable minimum for realtime stats.
Common causes of SSH errors:
  • Wrong credentials — check ROUTER_IP, ROUTER_USER, and ROUTER_PASSWORD in your .env file.
  • Router unreachable — verify network connectivity from the web server to ROUTER_IP:ROUTER_PORT.
  • SSH daemon not running — on OpenWrt, ensure dropbear is active: service dropbear status.
For configuration details see the configuration guide and the authentication API reference.

Build docs developers (and LLMs) love