• Stars
    star
    173
  • Rank 220,124 (Top 5 %)
  • Language
    Shell
  • License
    Other
  • Created over 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Linux bandwidth monitor with per-device tracking

wrtbwmon

Modified from https://code.google.com/p/wrtbwmon/.

Testers needed for IPv6 support

Experimental release: https://github.com/pyrovski/wrtbwmon/releases/tag/0.37_ipv6

Features

  • "User" column has mouseover text containing MAC and IP addresses
  • "First seen" and "Total" columns in usage table
  • Monitoring of locally generated traffic on a per-interface basis
  • remove function to delete iptables rules

What does it do?

wrtbwmon was designed to track bandwidth consumption on home routers. It accomplishes this with iptables rules, which means you don't need to run an extra process just to track bandwidth. wrtbwmon conveniently tracks bandwidth consumption on a per-IP address basis, so you can easily determine which user/device is the culprit.

Here is an example usage table: image

How do I use it?

  • Install: Download and install ipk from the releases page
  • Setup: wrtbwmon setup
  • Update table: wrtbwmon update /tmp/usage.db (you can place the data table anywhere)
  • Create html page: wrtbwmon publish /tmp/usage.db /tmp/usage.htm
  • Dump table to terminal: wrtbwmon dump /tmp/usage.db
  • Remove: wrtbwmon remove

Installation options

  • Install ipk
    • e.g.,:
      • cd /tmp
      • HTTPS: curl -LO https://github.com/pyrovski/wrtbwmon/releases/download/0.36/wrtbwmon_0.36_all.ipk
      • HTTP: you're on your own :( Busybox wget usually doesn't have SSL support.
      • OpenWrt: opkg install /tmp/wrtbwmon_0.36_all.ipk
  • Install deb from the releases page
  • Or, if you don't want to use an ipk or a deb:
    • cd /tmp
    • HTTPS: curl -L https://github.com/pyrovski/wrtbwmon/archive/0.36.tar.gz | tar xvz
    • cd wrtbwmon-0.36
    • ./install.sh wrtbwmon readDB.awk usage.htm1 usage.htm2 wrtbwmon
      • Currently, this depends on the install program. OpenWrt chose to provide this as the "coreutils-install" package.
  • Or, if you have make, just make install as root after cloning/unpacking.

Configuring the published table

  • wrtbwmon checks a few files for MAC -> name maps:
    • 4th argument to wrtbwmon publish <DB> <userDB>
    • /tmp/dhcp.leases
    • /tmp/dnsmasq.conf
    • /etc/dnsmasq.conf
    • /etc/hosts
  • If all of the above do not yield a match, the script will optionally perform a reverse DNS lookup directed at the DNS server specified in the DNS variable. If DNS is blank or unset, the script will not perform such lookups.

Regular updates

  • Add the following to root's crontab:

      # adapt PATH to your needs
      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    
      * * * * * <script location> update /tmp/usage.db
      0 * * * * <script location> publish /tmp/usage.db /tmp/usage.htm
    
  • On OpenWRT you need to enable cron as it is disabled by default:

      /etc/init.d/cron start
      /etc/init.d/cron enable
    
  • Enable web serving of the generated page (optional) This varies by environment, but for lighttpd:

      ln -s /tmp/usage.htm /var/www/html/
    

Remove iptables rules

  • wrtbwmon remove

More Repositories

1

watts-up

Watts Up Pro power meter interface utility for Linux
C
37
star
2

h264-v4l2-capture

h264 v4l2 capture for Logitech c920, etc
C
17
star
3

papi

Performance Application Programming Interface
C
15
star
4

powertools

library for power, frequency, and temperature measurement on Intel processors
C
11
star
5

cublasSgemmBatched-example

C++
8
star
6

Google-Maps-heatmap

PHP
5
star
7

zyxel-c1000z-firmware

Firmware source for the Zyxel C1000Z DSL modem/AP combo device.
C
4
star
8

aniruddha-times

R
2
star
9

allocation-times

R
2
star
10

scalasca

C++
2
star
11

openwrt-14.07

from git://git.openwrt.org/14.07/openwrt.git
Diff
1
star
12

reconciler

Match a set of torrent files against file paths from a database and optionally add the torrents to Transmission at the appropriate path
Go
1
star
13

dpfs

Distributed parallel filesystem
C++
1
star
14

simpad-serload

SIMpad serload for Linux, from http://opensimpad.org/images/6/6b/Serload-1.1_cvs.tgz
C++
1
star
15

phash

perceptual hashing
Go
1
star
16

papi-rapl

rapl component for PAPI
C
1
star
17

cgroup-interface-restriction

Demonstration of restricting network interface access by cgroup
Shell
1
star
18

Rodinia-2.0.1

From Rodinia 2.0.1, https://www.cs.virginia.edu/~skadron/wiki/rodinia
C
1
star
19

kismet-log-viewer

original from http://klv.professionallyevil.com/
Python
1
star
20

NAM-Maize-data-preparation-example

NAM Maize data preparation scripts
MATLAB
1
star
21

Acromag-Industry-Pack-module-and-carrier-hardware-interface

Kernel module, example code, development headers for Acromag Industry Pack module and carrier hardware interface
C
1
star
22

Large-Scale-Forward-Regression-using-a-partitioned-linear-model

C++
1
star
23

parallel-datafile-generation

developed in conjunction with https://github.com/pyrovski/Large-Scale-Forward-Regression-using-a-partitioned-linear-model
C++
1
star
24

rutils

R utility functions
R
1
star