Community discussions

MikroTik App
 
mlenhart
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Mon Oct 30, 2017 11:30 pm

Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 4:40 pm

Hello anyone,

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...

Thank you.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 4:45 pm

Those counters can only be reset by rebooting the router.
 
mlenhart
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Mon Oct 30, 2017 11:30 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 4:50 pm

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...
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 5:30 pm

Did you consider the possibility that you might just be one of the few people in the world who would want to reset these counters?
 
mlenhart
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Mon Oct 30, 2017 11:30 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 5:43 pm

Did you consider the possibility that you might just be one of the few people in the world who would want to reset these counters?
Yes, but seems stupid that low-cost D-Link routers can do this without any issues and MikroTik can´t, LOL

Well, then tell me how do you count your TX/RX data if you have data measured program from your ISP and this is reset every 1st day of month?
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 5:52 pm

I don't, I have better ISP without limits. :)

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"?
 
mlenhart
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Mon Oct 30, 2017 11:30 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 6:05 pm

I don't, I have better ISP without limits. :)
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 :D
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 6:23 pm

I'm pretty sure ISPs don't count user's data by looking at interface counters and resetting them every 1st of the month. :D

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.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 6:48 pm

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.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 8:54 pm

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.
 
mlenhart
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 84
Joined: Mon Oct 30, 2017 11:30 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 9:18 pm

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.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 10:03 pm

That's the spirit!

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.
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Reset counters - no way or bug in WinBox?

Fri Feb 23, 2018 10:42 pm

Or, better yet, use a tool that was designed for this, radius, AAA - authentication, authorization, ACCOUNTING
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Sat Feb 24, 2018 12:52 pm

That works only for user-connection-related traffic, I think. So you can use it for PPP, PPPoE etc but not for plain ethernet.
 
fizzyade
just joined
Posts: 5
Joined: Thu Feb 16, 2017 12:20 pm

Re: Reset counters - no way or bug in WinBox?

Fri Sep 20, 2019 1:18 am

I need this, but you’re saying it can’t be done because the hardware counter is only reset at boot?

here’s the pseudo code for you ;)

// startup

interface->last_drop_count=0;

// UI handler

If (click==RESET_COUNTERS)
interface->last_drop_count = interface->current_drop_count;

// GUI update

//show_value(DROP_COUNT, interface->current_drop_count);

show_value(DROP_COUNT, interface->current_drop_count-interface->last_drop_count);

Reset counters should really do this.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Fri Sep 20, 2019 11:37 am

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.
 
fizzyade
just joined
Posts: 5
Joined: Thu Feb 16, 2017 12:20 pm

Re: Reset counters - no way or bug in WinBox?

Sat Sep 21, 2019 2:16 am

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.

It would be extremely useful for monitoring.
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 3006
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: Reset counters - no way or bug in WinBox?

Sat Sep 21, 2019 3:26 am

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.

It would be extremely useful for monitoring.
there are other counters that if reset and can be used for diagnosis
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Sat Sep 21, 2019 12:19 pm

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.

It would be extremely useful for monitoring.
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?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11598
Joined: Thu Mar 03, 2016 10:23 pm

Re: Reset counters - no way or bug in WinBox?

Sat Sep 21, 2019 2:34 pm

I could request such a special feature in the router, but who else would be interested?

Probably not many other people would really need such feature ... but that shouldn't stop you from bitching around :wink:
 
abrehmc
just joined
Posts: 2
Joined: Wed Apr 06, 2022 12:03 pm

Re: Reset counters - no way or bug in WinBox?

Tue Jan 30, 2024 11:42 am

I could request such a special feature in the router, but who else would be interested?

Probably not many other people would really need such feature ... but that shouldn't stop you from bitching around :wink:
I really do wonder why some people have the need to put down and belittle other users. This is a valid question, and an annoying feature that could easily have been added.
Consider this: You have a WiFi network with a MikroTik router as AP, and there are 10+ users around. Knowing WiFi and MikroTik, you could face a slight challenge here. So to troubleshoot, you go to CAPsMAN -> registration table to see who is the biggest talker.
But, 2 TV's running a stream from the Sales department are on top of the list, and everyone else is not shutting down their PC when they go home, so numbers are in the high GigaBytes. Now I just want to know who is CURRENTLY the top 10 talkers. But no, it seems no one would be interested in that...
I might have overlooked an obvious answer, and that's why I came here. And I am perfectly capable of taking in good advice.

But if you put forth a perfectly valid question, and you have to rely on someone to get an answer, I my opinion, you should just mute people that that gives rude answers. There are ways of giving you an answer in a polite and civilized manner.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10223
Joined: Mon Jun 08, 2015 12:09 pm

Re: Reset counters - no way or bug in WinBox?

Tue Jan 30, 2024 4:45 pm

Well, for WiFi I use the usermanager to allow a limited set of MAC addresses and assign them the VLAN I want.
(unfortunately the new WiFi driver cannot do that anymore...)
But with this config, the connection time and amount of data is also maintained by usermanager. So I have an overview of that.

Who is online

Users browsing this forum: Bing [Bot] and 56 guests