Community discussions

MikroTik App
 
sclemens
just joined
Topic Author
Posts: 2
Joined: Tue Sep 22, 2009 8:05 pm

Clearing Ethernet Counters

Fri Jan 29, 2010 9:09 pm

I've been spending the last hour or so trying to find a way to clear Ethernet counters on a 4.5 x86 router. Right now, it has a ton of Rx Errors listed (more than 2 million), and we've fixed the problem. So, I'd like to have this reset so no one can look at this months down the road and assume there's a problem.

I've tried doing "/interface ethernet reset-counters 0" which does not reset the counter of Interface 0 at all. I also tried "/interface ethernet reset-counters" and have it prompt me for the interface number, with the same effect.

I found a script, but it doesn't appear to do much of anything. (included here for completeness)

# Clear Script Run Counters
# Counters can not be cleared but you can remove and add them back

:local sname
:local snumber
:local sruncount
:local ssource
:local spolicy

/system script

#Get Script Number
:foreach snumber in=[find run-count > 0] do={
# Get Script Number
:set sname [get value-name=name number=$snumber];
# Get Script Run-Count
:set sruncount [get value-name=run-count number=$snumber];
# Get Script Source
:set ssource [get value-name=source number=$snumber];
# Get Script Policy
:set spolicy [get value-name=policy number=$snumber];


#Remove Script
remove $snumber
#Add Script
add name=$sname source=$ssource policy=$spolicy

}


Does anyone have a method to clear the counters short of rebooting the router, or moving the interface (causing disruption of our downstream client.) I'm not finding anything else regarding this via google or the forum search function.

Shawn

Who is online

Users browsing this forum: normis and 188 guests