Prometheus exporter for Keenetic routers. It reads the router's RCI API (the API the web UI uses) and reports system, Internet/ISP, interface, Wi-Fi and client metrics. Tested on KeeneticOS 5.1.
docker run -d -p 10062:10062 \
-e KEENETIC_ENDPOINT=http://192.168.1.1 \
-e KEENETIC_USERNAME=exporter \
-e KEENETIC_PASSWORD=secret \
dev0nizer/keenetic-exporter
Metrics are served at /metrics and a health check at /healthz. The image
is distroless, runs as non-root and includes a HEALTHCHECK.
| Variable | Required | Description |
|---|---|---|
KEENETIC_ENDPOINT | yes | Router URL, e.g. http://192.168.1.1 |
KEENETIC_USERNAME | yes | Router user |
KEENETIC_PASSWORD | yes* | Password |
KEENETIC_PASSWORD_FILE | * | File holding the password (Docker secrets) |
EXPORTER_PORT | no | Port to listen on, default 10062 |
KEENETIC_TIMEOUT | no | Scrape timeout, default 10s |
KEENETIC_INCLUDE_INACTIVE_CLIENTS | no | Also export offline clients, default false |
LOG_LEVEL | no | debug, info (default), warn, error |
* Set either KEENETIC_PASSWORD or KEENETIC_PASSWORD_FILE. If a required
setting is missing, the exporter exits with an error.
The default port 10062 is not used by other exporters listed in the Prometheus default port allocations.
Router user: don't use the admin account. In Users and access, create a user with only the Web Interface and Prohibit saving system settings permissions. That gives the exporter read-only access.
Each scrape makes 2 HTTP requests, however many clients or interfaces the router has. The first request finds what exists right now (interfaces, ISPs, clients). The second fetches counters only for interfaces that are up. Interfaces that are missing or down are never queried. New clients and ISPs appear automatically, and removed ones stop being exported.
All metrics start with keenetic_:
up, scrape_duration_seconds, scrape_requests, scrape_command_errorsinfo: model, firmware and hostname as labelssystem_*: CPU, memory, swap, uptime, conntrackinternet_*: Internet, gateway, DNS and captive-portal reachabilityisp_*: per-ISP up, default gateway, priority, ping-checkinterface_*: state, link, uptime, MTU, speed, rx/tx bytes, packets, errors and dropswifi_radio_*: channel, temperatureclients: active clients per segment and connection type (wifi/wired)client_*: per-client (by MAC) traffic, uptime, RSSI, Wi-Fi rateNames, IPs and SSIDs are in *_info metrics. Join them by label:
rate(keenetic_client_receive_bytes_total[5m]) * on(mac) group_left(name) keenetic_client_info
Content type
Image
Digest
sha256:d90aa1d10…
Size
4 MB
Last updated
about 9 hours ago
docker pull dev0nizer/keenetic-exporter