I was investigating this today and stumbled upon a of interesting things. First is, I have managed to add a field to the graphs on the Traffic Graphs page that represent Total Incoming/Outgoing Usage for that graph.
This is close to what i'm looking for, however, not exactly. This is because the graphs show a time period relative to the current time. So, one week back may include data from the previous month. The period of the past month would only be valid at 12:00 on the first day of the month.
If you would like to add these fields anyway as they may be of value to someone edit the file /usr/local/bin/makegraphs.pl
In the sub updateifgraph, at line 420 add the following:
"VDEF:inctotal=incoming,TOTAL",
"VDEF:outtotal=outgoing,TOTAL",
This will define the totals for the period as vnames and allow them to be printed.
Next add the lines to print at the end of the current statement. Find the lines that look like this:
"GPRINT:outgoing:AVERAGE:%12.3lf %sBps",
"GPRINT:outgoing:LAST:%12.3lf %sBps\\n");
Modify them by inserting the last two lines of the following text in between the double quote and the ");" The code should look like this afterwards:
"GPRINT:outgoing:AVERAGE:%12.3lf %sBps",
"GPRINT:outgoing:LAST:%12.3lf %sBps\\n",
"GPRINT:inctotal:Total Incoming\\:%12.3lf %sB\\n",
"GPRINT:outtotal:Total Outgoing\\:%12.3lf %sB\\n");
After that run
/etc/cron.cyclic/makegraphs
This job I think is run every 5 minutes or so, but that will update the graph images that appear on the graph pages. You should see the changes that were made.
Another thing that I found was the application called ipacsum. This is installed on endian by default and allows for summing of the IP traffic through iptables.
Run the following to get the IP accounting data from previous months:
ipacsum -t "the month 1 months ago"
ipacsum -t "the month 2 months ago"
ipacsum -t "the month 3 months ago"
ipacsum -t "the month 4 months ago"
The problem with this method is the results are different from what is being displayed on the Traffic Graphs. Over the course of a year or so the numbers are different by several hundred gigs. The results are different at a week's time. I have a feeling that these methods are looking at different data, or the same data differently.