How to Record and Graph users Bandwidth per ip address

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
jlct021
Posts: 8
Joined: Fri Sep 09, 2011 8:03 am

How to Record and Graph users Bandwidth per ip address

Post by jlct021 »

Hi

I'm using Mikrotik equipment and would like to record / graph users bandwidth usage based on their IP addresses. (separating local traffic from Internet traffic as I have a file share that users download from.)

I understand Mikrotik to have a tool called "Traffic-Flow" which can export traffic passing through it; but am unsure where to send this traffic / what must be done from there in order to get it into nice looking graphs.

The outcome / graphs I'm looking to create are Bandwidth usage (in / out / total) per user based on their IP address in daily / weekly / monthly intervals.

Using Linux Mint for my desktop / have installed Cacti but am not sure how to start it up. Will eventually set up a Debian Stable box specifically for the exercise.

Any help very welcome.

Thanks.
Last edited by jlct021 on Thu Jan 05, 2012 2:08 pm, edited 1 time in total.
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: How to Record and Graph users Bandwidth per ip address

Post by cigamit »

Roughly how many users are we talking about? And are the IPs static?
jlct021
Posts: 8
Joined: Fri Sep 09, 2011 8:03 am

Re: How to Record and Graph users Bandwidth per ip address

Post by jlct021 »

roughly 10 users with Static IP's, some Wireless some LANed.
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: How to Record and Graph users Bandwidth per ip address

Post by cigamit »

I can think of 2 possible ways to do this.

The easy way.
In your Mikrotik, create 2 Mangle rules for each IP you want to monitor. One for inbound, one for outbound (one will have the source as the ip, the other will have the destination as the IP). In this rule, you will tell it to mark the packet (create a unique name for each). Then you will create some queues for each of those. Then search the forums for "mikrotik queue" and you should find some templates to graph those queues. If you want inbound and outbound on the same graph, then you will probably have to customize the templates a little bit (or create aggregates using the Aggregate Plugin).


The hard way
(I am giving basic steps, most you would have to figure out the exact steps yourself)
Have your mikrotik setup to export flow data to your cacti server. Setup flow-tools, etc... on the cacti server to collect the data. Then create a script that uses the flow-tools reporting binaries to create "Source IP" and a "Destination IP" reports. The script will then parse the reports for the appropriate IPs, and save the data off (should probably run on a cron). Then create a script in cacti to parse that saved data file for the data for the specific IP for the graph it is polling.
jlct021
Posts: 8
Joined: Fri Sep 09, 2011 8:03 am

Re: How to Record and Graph users Bandwidth per ip address

Post by jlct021 »

Thanks for the reply.

I like the sound of the second option but at this stage writing scrips etc is beyond my current level of know how so will explore the first option.

Is there an more automated way of achieving the second option ie the cactiEZ CD?

Ive read that using flow exports etc is much more accurate as should the router need to be rebooted, there is a very good chance of you loosing all historical data.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest