I'm looking for some easy way how to get some traffic not IP based statistics, but traffic on every interface.
I can see accounted traffic with command:
/interface print stats
but results aren't scripting friendly. Of course there is possibility to use linux tools like cut, awk, etc, but maybe there is some more efficient way?
My goal is to make some sql (mysql) database with hourly traffic on interfaces. Idea is to make some simple shell script to get data from router via ssh or in other way and feed it to db.
If you’re going to be contacting external sources like MySQL, you might as well use the the API protocol, and one of the clients in particular.
If PHP is your programming language of choice, I’d reccomend my own client (see my signature), but obviously, I’m biased .
I’ve already described in another post in another topic how to continiously collect stats to be visualized later. Reworking that to collect summary hourly data instead should be easy.