I would like to be able to query the total bytes in and out of an interface over time.
What command should I call to achieve this?
Further info:
I am wanting to drive logic based on total throughput over time, I am hoping that I can query the throughput per minutem I was thinking to query total RX+TX, then clear counters, then repeat over time to get a usage profile.
Using “/interface/print” with “stats-detail” attribute set, you can view what you see in Winbox. To target a specific interface, you’ll have to also include a query word checking the name.
As you might guess, the “tx-byte” and “rx-byte” attributes in the reply are those you’re interested in.
I could give you a code example, if you could tell me the client you’re using.
Thanks, I got it working in c# as follows:
mikrotik.Send("/interface/print");
mikrotik.Send("=stats");
mikrotik.Send("=.proplist=.id,rx-byte,tx-byte");
mikrotik.Send("?=name=ether1-gateway", true);
BTW, if you’ll be using C#, why not consider using mikrotik4net as your client?