could anyone please advise how to reset counters on interfaces in main interface screen (after login via WinBox and clicking on Interfaces)?
I am running on 6.41.2 (stable) on multiple devices: hAP ac Lite, RB2011UiAS-2HnD, RB951G-2HnD but I do not see any option in WinBox 3.12 to reset the counters…
Am I blind (I hope no) or overlooking something?
I have found it just after clicking on particular interface, but this will not reset the overall statistics for the interface (Tx bytes; Rx bytes) in main interface list screen, only in Overall statistics for that interface…
really? no other way?
I tought that MikroTik is a little more intelligent device… This comes to me as a stupid idea to reboot the device everytime I need just to reset the counters…
But if I had that problem, I would take a note of the numbers and then I’d substract them from current ones. And of course not manually, some simple script somewhere would take care of it. Or some snmp base monitoring. Relying just on router’s interface counters is not practical solution anyway. What if your router reboots in the middle of the month (because of power outage of something), how will you know how much data you have left? How often you write down the numbers as “backup”?
Sometimes you don´t have a choice…
On the other hand, if YOU are an ISP, how do you do statistics which user is (potentially) abusing your network or infected by virus? Counters can help in these situations…
Relying just on router’s interface counters is not practical solution anyway. What if your router reboots in the middle of the month (because of power outage of something), how will you know how much data you have left? How often you write down the numbers as “backup”?
This is sadly true, and I have no answer for this… yet
I’m pretty sure ISPs don’t count user’s data by looking at interface counters and resetting them every 1st of the month.
Your answer is some automated solution. Something needs to check the couters periodically and save current state. It must also detect reboots, when the numbers become lower than before. I don’t know if you could run some monitoring software somewhere, but worst case, it should be possible to solve it on router using script. I don’t have one and I’m not good with RouterOS scripting, but it shouldn’t be too hard.
You can reset only counters from ethernet interface driver (the ones you see un /interface ethernet print stats).
If you really want to rely on such data, then use
driver-rx-byte
driver-tx-byte
from Ethernet stats.
You can, as already suggested above, regularly fetch the counters using SNMP and keep the value on 00:00 at the first of the month in some data file, also keep the value you last read (e.g. last hour when you read it every hour) and when that value is lower keep the previous one for bookkeeping.
That way you can accumulate what data you used in this month.
It will require a small program, the kind that almost half of all people could write in BASIC when the personal computer first became prevalent in homes in the eighties.
Of course today almost nobody can do that anymore, today everyone only can click LIKE on Facebook. So functions like this always have to be made by “someone else”.
Now you are not in luck, because almost nobody is interested in such a function.
Well, my preferred way was to avoid writing some scripts for that, but if there is no other way, I have to do that
It will take some time, definitely, but it can’t stop me.
Easiest way would be is you had some webserver available (your own, shared hosting, anything) with php. Then all you’d need on router would be just few lines to send current counters to your server and all further processing could be done there. You could then access the page with statistics using any device that can use http. You could make pretty graphs if you’d want to. Or prediction if you should slow down with your usage. Sky is the limit.
Or you can use it as opportunity to learn RouterOS scripting.
You should understand that these counters are not intended for user applications (like bookkeeping of ISP data limits), but rather are statistics of the hardware drivers.
When you have a Linux system you will note that these counters are not resetable there either.
thats the exact reason i want to be able to reset it, i was having hardware issues with a SFP module and being able to reset the counter would make it extremely easy to see if there is a problem.
as i said above, even if it cant be reset at the driver level it can be shown by subtracting a previous value to give the delta. Heck, you could even show both “Drops (Absolute)” and “Drops (Delta)”. reset counter sets the previous value to the current absolute value. when the values are “rendered” the delta value is the current absolute - previous.
When you have such specialistic requirements you can quite easily write a small PHP or Perl program that uses API to retrieve the info and present it in the way you like most.
For example, I wrote such a thing to display the BGP AS number of all routes and add a flag when it does not match the value stored in a fixed table.
I could request such a special feature in the router, but who else would be interested?