Community discussions

MikroTik App
 
User avatar
katem07
just joined
Topic Author
Posts: 17
Joined: Mon Apr 10, 2017 11:35 am
Location: SAR
Contact:

Ethernet Rate Detector Project !  [SOLVED]

Sun Mar 24, 2019 5:14 pm

Hey all

I have more than 30 Mikrotik servers over my network, Recently i had a problem with my rj45 connectors due to humidity and rain

The problem as known is to get ethernet rate "10Mbps", So i tried to make a simple script .. who will check all my Ethernet names and rate's every while of time, And to report me by Telegram bot if there is a "10Mbps" Ethernet rate with a message contains the damaged ethernet name ...

All is working fine, Except to define the damaged one, it fails with me ...

So i'm looking for The Genius Guy :D
/interface ethernet monitor [find] once do={
:if ($"rate" = "10Mbps") do={
/tool fetch "https://api.telegram.org/botXXX/sendMessage\?chat_id=XXXX&text=Ether $XXX rate is 10Mbps" keep-result=no;}
}
I think it's Possible to success !
Last edited by katem07 on Tue Apr 23, 2019 6:15 pm, edited 1 time in total.
 
User avatar
katem07
just joined
Topic Author
Posts: 17
Joined: Mon Apr 10, 2017 11:35 am
Location: SAR
Contact:

Re: Ethernet Rate Detector Project !

Thu Mar 28, 2019 11:06 pm

:shock:
Last edited by katem07 on Tue Apr 23, 2019 6:16 pm, edited 1 time in total.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3372
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Ethernet Rate Detector Project !

Fri Mar 29, 2019 8:17 am

What is the question?

Since script does works fine and I do work using Splunk to monitor Mikrotik (see link in my signature) I would have sent data out suing syslog.

Some like this:
/interface ethernet monitor [find] once do {:if ($rate="1Gbps") do {:log info message=("interface=".$name." speed=".$rate)}}
Er even better, send all interface speed at every schedule so you can graph it nicely over time.
/interface ethernet monitor [find] once do {:log info message=("interface=".$name." speed=".$rate)}