Community discussions

MikroTik App
 
dadaniel
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Fri May 14, 2010 11:51 pm

problem comparing rx-fcs-error value

Wed Nov 03, 2021 3:18 pm

I wrote a script to send me an alert mail when FCS error counter on an interface increases.
:local intrxfcs [/interface ethernet get 0 rx-fcs-error]
:if ([:tonum $intrxfcs] > 1) do={:set $alert 1}
I'm facing two problems:
  • the value of rx-fcs-error contains a space after the first two digits
  • :tonum function only works up to integer limit and returns nothing if value is greater than that
As a workaround i used:
:if ([:len [:tostr $intrxfcs]] > 1) do={:set $alert 1}
but then the value have to reach 10 (2digits) before I get the alert.

Is there a way to solve this?
 
dadaniel
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Fri May 14, 2010 11:51 pm

Re: problem comparing rx-fcs-error value

Fri Jan 14, 2022 12:26 pm

*bump*
 
RevngeZA
just joined
Posts: 5
Joined: Fri Sep 30, 2016 8:43 am

Re: problem comparing rx-fcs-error value

Fri Jan 14, 2022 12:37 pm

Is there any reason why you want to use a script?

I would suggest using a third party software to monitor this errors.

We use LibreNMS and it works like a charm.

Who is online

Users browsing this forum: UkRainUa and 17 guests