Network Traffic Analyzer with RaspberryPI

 MySQL, Network, Python, Raspberry  Comments Off on Network Traffic Analyzer with RaspberryPI
Aug 202016


Melbourne just won the “most liveable city 2016”, the 5th time in a row.
That’s awesome, but it comes with a price, and the one you’d think of: internet here sucks!

Sounds weird, isn’t it?
Well, one of the reasons Melbourne is such a great city, is it’s size, the amount of people in it and the direct result of very low capita per square meter. In simple words, it means we live very far from each other, which means we live far from the ADSL Exchange and for some of us, even only tens of Kms from the CBD (“downtown”), it’s too expensive and even not available to ADSL connection to their property.
I happen to have such friends.
Their only solution is to use 4G connection. Surprisingly, since it’s a new technology unlike ADSL, it’s quite good. But it has a limit: amount of traffic and the cost of excess usage.

Why am I blabbing about it? Cause I can… Nah, mainly case this is the reason for me to create this little project.
For them, having kids, they need to control their usage and know who of the kids has youtube their 4G to a very expensive invoice.

I was looking at already existing tools, mainly around linux, and could find many real-time cli tools (love cli tools!) like nload, iftop, nethogs, jnettop and more.
But thsoe are real-time tools and I need a long-time tool.
ntop is the next on the list, and it’s even running on RPi. I’ve checked. The problem with it: it’s not keeping old traffic for ever. you cannot see what happened even few hours ago if the stream is gone.

I decided I’ll build one.
In the light of my K.I.S.S philosophy, I made it to suit my needs, made it simple, easy to use and install with no frills.

Continue reading »