WAN Traffic By Month

From DD-WRT Wiki

Jump to: navigation, search

Contents


[edit] Introduction

Your total WAN traffic by Month is shown on a graph on the Status / WAN page at: http://192.168.1.1/Status_Internet.asp
Here is an example:
Traffic By Month Sample

The raw data is backed up and restored when you use the Administration / Backup page at http://192.168.1.1/config.asp

You can look at the raw data in NVRAM. Log on to the router using Telnet or SSH, or use the Administration / Commands page at http://192.168.1.1/Diagnostics.asp

This command will display all of your traffic statistics and settings:

    nvram show | grep traff[-_]

if ttraff_enable=1 your traffic data collection is on.
if ttraff_enable=0 your traffic data collection is off.

The traffic data is kept in nvram variables that look like this:

    traff-06-2008=7322:3488 2526:2769 1127:382 673:202 1048:284 11455:3737 3613:1253 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0

Notice the naming: traff-mm-yyyy, where mm is month and yyyy is year. The data for each day is kept in pairs of inbound / outbound megabytes. 7322:3488 is for June 1 2008, 7322 MB incoming, 3488 MB outgoing.


You can display data for a single month with a command like this:

    nvram get traff-06-2008

You can restore data for a single month with a command like this:

    nvram set traff-04-2008="1:1 1:1"

You have to do a commit or the data will be lost at your next reboot:

    nvram commit

You can also see the traffic data in the backup files.

This gives you a way to restore traffic data without restoring all the settings in the router.