Web application for monitoring OpenWrt-based devices and Teltonika routers through their HTTP JSON-RPC interfaces.
The app reads a TOML configuration file, polls devices from the server side, and shows their current connection and system details in the UI. It supports the LuCI auth + exec flow used by OpenWrt and the ubus session flow used by Teltonika devices.
References:
- https://wiki.teltonika-networks.com/view/RUT240_Monitoring_via_JSON-RPC_linux
- https://documenter.getpostman.com/view/5972215/TVzNHeej#154b5d84-4065-4887-a5a8-c1f3b51fe9a6
- https://techlibrary.doodlelabs.com/json-rpc-api-guide
opkg update
opkg install luci-mod-rpc luci-lib-ipkg luci-compat
/etc/init.d/uhttpd restartJSON-RPC API must be enabled on the device. Also, it need the be accessible. If you want to use it on the WAN side, add a firewall rule that allow access to 80/tcp and 443/tcp.
Test the connection to the device:
curl:
$ curl https://10.0.0.3/cgi-bin/luci/rpc/auth --data '
{
"id": 1,
"method": "login",
"params": [
"root",
"password"
]
}'
{"id":1,"result":"2911aa45e1f9dd2c7f7b8ff2cf9a70b6","error":null}httpie:
$ $ echo '
{
"id": 1,
"method": "login",
"params": [
"root",
"password"
]
}' | http --json POST 10.0.0.3/cgi-bin/luci/rpc/auth
{
"error": null,
"id": 1,
"result": "babab27ac62d284fe72484a0d6daf3ff"
}- Device status monitoring - Poll OpenWrt and Teltonika devices from the server
- Config editor - Edit the TOML configuration from the UI
- Device details - Show model, hostname, uptime, interfaces, memory and other status data when available
- Server-side tracing - Structured logging with debug output to the frontend
- Responsive UI - Built with Leptos and Tailwind CSS v4
- Rust 2024 edition
- Leptos 0.8 (SSR + hydrate)
- Axum 0.8
- Tailwind CSS v4
cargo-leptosandcargo-make
Recommended: use the provided Nix shell to get all build tools and dependencies:
$ nix-shellThe shell provides: rustc, cargo, cargo-make, cargo-leptos, tailwindcss, lld, wasm-bindgen-cli and binaryen (wasm-opt)
- Enter the dev shell:
$ nix-shell- Create a configuration file. Example
wrtctrl.toml(use the *.sample file to get started):
[generic]
polling_interval = 30
[[devices]]
name = "RUT241"
type = "teltonika"
ip_address = "10.0.0.1"
username = "admin"
password = "password"
[[devices]]
name = "OpenWRT 25.12"
type = "openwrt"
ip_address = "10.0.0.3"
username = "root"
password = "pasword"- Start the hot-reload development server:
$ cargo make dev- Open: http://127.0.0.1:3011
Debug build:
$ cargo make build-devRelease/musl build (static binary):
$ cargo make build-muslRun formatting and checks:
$ cargo make checkFull CI pipeline (check → test → build):
$ cargo make ciwrtctrl uses TOML configuration. Lookup order:
WRTCTRL_CONFIG_FILEenvironment variable (if set)/etc/wrtctrl/config.toml./wrtctrl.toml(current working directory)
[generic].polling_interval- Polling interval in seconds, minimum 1, default 30polling_interval- Legacy top-level fallback for the same setting[[devices]]- Device entries to poll and editdevices[].name- Display name shown in the UIdevices[].type- Device platform, currentlyopenwrtorteltonikadevices[].ip_address- Device host or URLdevices[].username- Login user for the JSON-RPC endpointdevices[].password- Login password for the JSON-RPC endpointdevices[].comment- Optional free-form note
The UI writes the same TOML layout back to disk when you save changes.
Build and run in Docker:
$ docker build -t wrtctrl .
$ docker run -p 3021:3021 -v /etc/wrtctrl:/etc/wrtctrl wrtctrl- Fabian Affolter (https://github.com/fabaff)
MIT. See LICENSE.