最後更新: 2015-12-04
bwm-ng (small and simple console-based live network bandwidth monitor)
bwm-ng v0.6 (probing every 0.500s), press 'h' for help input: /proc/net/dev type: rate / iface Rx Tx Total ============================================================================== vmbr0: 1.33 KB/s 0.39 KB/s 1.73 KB/s lo: 0.00 KB/s 0.00 KB/s 0.00 KB/s eth0: 1.65 KB/s 0.39 KB/s 2.04 KB/s ------------------------------------------------------------------------------ total: 2.98 KB/s 0.79 KB/s 3.77 KB/s
* KB = KByte
bmon (a portable bandwidth monitor and rate estimator)
interface: vmbr0 at myserver bmon 2.0.1 # Interface RX Rate RX # TX Rate TX # qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq myserver (source: local) 0 vmbr0 1.01KiB 18 1.22KiB 2 1 lo 0.00B 0 0.00B 0 2 eth1 0.00B 0 0.00B 0 3 eth0 1.28KiB 18 1.22KiB 2 4 vmbr1 0.00B 0 0.00B 0 qqqqqqqqqqqqqqqqqqqq Press g to enable graphical statistics qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqq Press d to enable detailed statistics qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq ^ prev interface, v next interface, <- prev node, -> next node, ? help
Display Settings
g Toggle graphical statistics
d Toggle detailed statistics
c Toggle combined node list
l Toggle interface list
f (Un)fold sub interfaces
Write HTML statistics
opkg install uhttpd bmon
/etc/init.d/uhttpd start
mkdir /tmp/bmon
ln -s /tmp/bmon/ /www/
bmon -O html:path=/www/bmon/
iftop
Historical data graphs for router
* wrtbwmon (basic shell script) [Per User]
* vnstat + luci-app-vnstat
* collectd = luci_app_statistics
* bandwidthd (graphs and charts are built by individual IPs) [Per User]
Approximate order from most-basic to most-feature-rich:
wrtbwmon < vnstat < YAMon < luci_app_statistics < bandwidthd < ntop
========================
wrtbwmon
https://github.com/pyrovski/wrtbwmon
Backup Data
# local backup storage
15 * * * * cp /tmp/usage.db /mnt/usbdrive/wrtbwmon/
* * * * * [ ! -f /tmp/usage.db ] && cp /mnt/usbdrive/wrtbwmon/usage.db /tmp/
# online backup storage
15 * * * * cd /tmp && ftpput -u username -p password usage.db . some_ftp_server_url
* * * * * [ ! -f /tmp/usage.db ] && wget some_url/usage.db -O /tmp/usage.db
Daily-log-rotation
0 0 * * * mv /tmp/usage.db /mnt/usbdrive/wrtbwmon/usage-$(date '+%Y.%m.%d').db
collectd
opkg install luci-app-statistics
opkg list | grep collectd-mod
/etc/init.d/luci_statistics enable
/etc/init.d/collectd enable