Sign inSign up

dev0nizer/keenetic-exporter

By dev0nizer

•Updated about 9 hours ago

Helm
Image
0

884

dev0nizer/keenetic-exporter repository overview

⁠keenetic-exporter

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.

⁠Usage

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.

⁠Configuration

VariableRequiredDescription
KEENETIC_ENDPOINTyesRouter URL, e.g. http://192.168.1.1
KEENETIC_USERNAMEyesRouter user
KEENETIC_PASSWORDyes*Password
KEENETIC_PASSWORD_FILE*File holding the password (Docker secrets)
EXPORTER_PORTnoPort to listen on, default 10062
KEENETIC_TIMEOUTnoScrape timeout, default 10s
KEENETIC_INCLUDE_INACTIVE_CLIENTSnoAlso export offline clients, default false
LOG_LEVELnodebug, 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.

⁠Router load

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.

⁠Metrics

All metrics start with keenetic_:

  • up, scrape_duration_seconds, scrape_requests, scrape_command_errors
  • info: model, firmware and hostname as labels
  • system_*: CPU, memory, swap, uptime, conntrack
  • internet_*: Internet, gateway, DNS and captive-portal reachability
  • isp_*: per-ISP up, default gateway, priority, ping-check
  • interface_*: state, link, uptime, MTU, speed, rx/tx bytes, packets, errors and drops
  • wifi_radio_*: channel, temperature
  • clients: active clients per segment and connection type (wifi/wired)
  • client_*: per-client (by MAC) traffic, uptime, RSSI, Wi-Fi rate

Names, 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

Tag summary

Content type

Image

Digest

sha256:d90aa1d10…

Size

4 MB

Last updated

about 9 hours ago

docker pull dev0nizer/keenetic-exporter