User Tools

Site Tools


doc:howto:vnstat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:vnstat [2013/01/01 21:08]
written_direcon
doc:howto:vnstat [2015/03/10 03:10] (current)
Nilfred [Setup] [bash] Split one-liner and output something on error
Line 17: Line 17:
  
 The common choice for monitoring is your WAN interface. To locate your WAN ifname and setup interfaces to monitor and create database do: The common choice for monitoring is your WAN interface. To locate your WAN ifname and setup interfaces to monitor and create database do:
-<​code>​vnstat -u -i $(uci -P/​var/​state show network.wan.ifname)</​code>​+<​code ​bash> 
 +. /​lib/​functions/​network.sh;​ if network_get_device if_wan wan; then 
 +vnstat -u -i $if_wan; else echo WTF! Is WAN up?; fi 
 +</​code>​
  
 +:!: The interface must be active for the above command to work.  See ticket [[https://​dev.openwrt.org/​ticket/​19116|19116]].
 ==== Database Updating ==== ==== Database Updating ====
 | {{:​meta:​icons:​tango:​dialog-information.png?​nolink}} | **This step is required for vnStat to function.** The package doesn'​t setup database updating at all. Its up to you to configure when vnStat will update. Use the daemon or a cron job. | | {{:​meta:​icons:​tango:​dialog-information.png?​nolink}} | **This step is required for vnStat to function.** The package doesn'​t setup database updating at all. Its up to you to configure when vnStat will update. Use the daemon or a cron job. |
Line 174: Line 178:
 </​code>​ | </​code>​ |
 Note: Dont use the first line if you haven'​t USB device. Note: Dont use the first line if you haven'​t USB device.
 +
 +===== Example =====
 +A video demonstration of how vnStat 1.11-4 in the repositories can be installed on OpenWrt 14.07 Barrier Breaker: https://​www.youtube.com/​watch?​v=VGd8Rekm970
doc/howto/vnstat.1357070891.txt.bz2 · Last modified: 2013/01/01 21:08 by written_direcon