GithubHelp home page GithubHelp logo

stieneee / wrt-link Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 0.0 88 KB

A bandwidth monitor and reporter for ddwrt routers.

Home Page: https://logmy.io

License: GNU General Public License v3.0

Shell 3.60% Makefile 4.23% Go 92.16%
ddwrt logging bandwidth bandwidth-monitor

wrt-link's Introduction

wrt-link

wrt-link is a Go application for the collection of bandwidth, connection and device stats from DD-WRT routers. Originally built to report to logmy.io the application reports periodically to an HTTP and could report to independently hosted endpoints.

Features

  • Bandwidth Logging
    • iptables (wrtbwmon)
    • ipconntrack scrapping for bandwidth
  • Device connection reporting scrapping ipconntrack
    • Configurable private devices
    • Black list checking
  • Router Stats
    • Device type, CPU type
    • DD-wrt version, kernel version
    • CPU
    • Memory
    • Space, NVRAM, CIFS, JFFS2
    • Active IP Connections
    • Device Hostnames
    • Wireless Settings
    • Wireless Clients
    • Nearby Wireless Devices
  • ISP Stats
    • Ping
    • Speedtest
    • DNS response time
  • Simple Endpoint Example - (Probably Nodejs and Mongodb in a Docker)

Prerequisites

A DD-WRT router with ssh access enabled. A reporting endpoint or an account with logmy.io. A 256 Byte RSA private key.

In the event this is being used in combination with logmy.io please follow the installation steps provided by logmy.io. There is no need to read any of the information here.

Compiling

make all

Installing

Ideally installation should occur via a startup script saved in the router's administration settings. For testing purposes the script can be deployed on the router manually. A full example will be made available in the future.

Manual Setup Example

SSH into your router and run the following commands. Generating a new rsa key and user account on the remote server to be used by the script is advised.

Alternatively scp could be used to retrieve the file securely from the ssh server.

Generate a New Private Key

# Location: Desktop
ssh-keygen -t rsa -f ~/wrt-link.id_rsa
scp ~/wrt-link-id_rsa [email protected]:/tmp/wrt-link.id_rsa

SCP Gateway

A public scp gateway is available for easy retrieval of the latest binary. The host key of the gateway must be added to the know_hosts.

# On Router
get.logmy.io ssh-rsa "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0zauQB43Zn2xReW3ULrP09ckJxK6rZ+V45SFIQ9J88AnjMhaZ/YVjr8FBRXsBWk3Mqgx38D4WfOpvpMTWieaA3xJoLvVVBWKp5Sm+hfZdsDoJFwI23POG2cJvsM08bvq7ifnXcQs5uncTR26sa60ZEfmWKvw7GXvXnbjb2XsnPzzJytVcVAblH4piaQzt6iLlb436iEBgMqzJaxemDQsX47uZhbcfKG+YCZEr/uyJMUWZbnhfpkme1YpW4Ob1cNf1Ff/aijUnir6qooVVMybRg8HmWkgV6gqzDGKn+yAEcSFXcZks39bwnM/ffzVe1qvvMQR55NcJ0jZihyVhFlpF" >> /tmp/root/.ssh/known_hosts
scp -P 222 [email protected]:latest/wrt-link-mips /tmp/wrt-link

The 'latest' directory on the remote host can be replaced with the version tag i.e [email protected]:0.2.0/wrt-link-mips.

Calling

The binary is called with the following three arguments.

  • API_ENDPOINT - The reporting HTTP endpoint.
  • ROUTER_ID - The unique ID of the router.
  • KEY_FILE - The file of the private key. /tmp/wrt-link.id_rsa from the example above.
/tmp/wrt-link {API_ENDPOINT} {ROUTER_ID} {KEY_FILE}

Contributing

Issues and pull requests are welcome.

License

This project is licensed under the GPL-3.0 license - see the LICENSE file for details.

Acknowledgments

This script was based on work from wrtbwmon.

wrt-link's People

Contributors

stieneee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.