A Prometheus exporter for luci-wrtbwmon to graph bandwidth usage per client.
luci-wrtbwmon is a Luci module that uses wrtbwmon to track bandwidth usage.
- A router running OpenWRT with luci-wrtbwmon package installed.
- Make sure Persist Database settings is checked in the Network > Usage > Configuration.
-
Create an SSH key-pair that this application will use to interact with OpenWrt router using SSH.
-
Build the included Dockerfile.
-
Run the Docker image with the SSH private key mounted and the following environment variables.
- SSH_HOST - IP Address/Hostname to the OpenWrt router.
- SSH_USERNAME - Username to be used to login to the router. Usually "root".
- SSH_IDENTITY - Path to the SSH private key file.
Example:
docker run -it \ -v /path/to/private/key:/key \ -e SSH_HOST=192.168.1.1 \ -e SSH_USERNAME=root \ -e SSH_IDENTITY=/key
-
Create an SSH key-pair that this application will use to interact with OpenWrt router using SSH.
-
Install dependencies with
npm install
. -
Set the following environment variables:
- SSH_HOST - IP Address/Hostname to the OpenWrt router.
- SSH_USERNAME - Username to be used to login to the router. Usually "root".
- SSH_IDENTITY - Path to the SSH private key file.
Windows:
set SSH_HOST=192.168.1.1 set SSH_USERNAME=root set SSH_IDENTITY=C:\Path\To\Private\Key
Unix:
export SSH_HOST=192.168.1.1 export SSH_USERNAME=root export SSH_IDENTITY=/path/to/private/key
-
Run the application
npm start
This exports the following metrics per MAC Address and IP Address
- Download Usage
- Upload Usage
- Total Usage
Metrics can be accessed at http://localhost:3000/metrics