traffic accountig using iptraf and rrdtool

I needed to get a report of our internet traffic, but the trick was that we had two categories of traffic

  1. internet traffic
  2. site-to-site vpn traffic

we needed to see how much traffic is being spent on vpn traffic and how much is being spent on other internet trraffic.

I got ntop, installed it and let it run for 1 day, it generated very good reports but didn't satisy our need, so here is what i hacked.

  1. I started iptraf
  2. Created a filter to only show vpn traffic
  3. Configured it to log to a file every 1 minute (this is not the best interval but that is what i did) - sample log file attached
  4. At the end of the day I parsed the log file and generated a rrd file of the traffic and generated a graph
     using the attached python script