Community discussions

 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Script to compare RX-Rate?

Tue Sep 04, 2018 3:55 am

Hello everyone!

I am looking for a script that compares the RX-Rate of wlan1 with a specific number and according to that execute another script, does someone help me? I was trying to do it but I can't find the correct parameters.

thousands of thanks
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Tue Sep 04, 2018 5:29 am

hi
I can help you, but explain more detail, what you want to do
now you got RX of each station
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :log info [/interface wireless registration-table get $WR rx-rate]
 }
} on-error={}
now, what next?
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Thu Sep 06, 2018 8:46 am

hi
I can help you, but explain more detail, what you want to do
now you got RX of each station
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :log info [/interface wireless registration-table get $WR rx-rate]
 }
} on-error={}
now, what next?
Hello! sorry for the delay!
I need the script to compare the RX-RATE with the number 20 and if it is less than 20, execute the Script2 and if it is bigger than 20 do not do anything. it is understood?

Thank you
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?  [SOLVED]

Thu Sep 06, 2018 12:42 pm

punch Accept this answer ✔ :wink:
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :local R [/interface wireless registration-table get $WR rx-rate];
 :local X [:pick $R 0 [:find $R "M"]] 
 :if ($X < "20") do={
 :log warning message=("Found rx-rate=" . $X . "Mbps");
 #
 # your custom script here
 #
 }
}} on-error={:log error message="script failed..."}
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 12:47 am

punch Accept this answer ✔ :wink:
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :local R [/interface wireless registration-table get $WR rx-rate];
 :local X [:pick $R 0 [:find $R "M"]] 
 :if ($X < "20") do={
 :log warning message=("Found rx-rate=" . $X . "Mbps");
 #
 # your custom script here
 #
 }
}} on-error={:log error message="script failed..."}
Can work like this?

:do {
:foreach WR in=[/interface wireless registration-table find] do={
:local R [/interface wireless registration-table get $WR rx-rate];
:local X [:pick $R 0 [:find $R "M"]]
:if ($X < "20") do={
:log warning message=("Found rx-rate=" . $X . "Mbps");
/interface wireless disable 1
/interface wireless enable 1
}
}} on-error={:log error message="script failed..."}
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 1:34 am

Can work like this?

:do {
:foreach WR in=[/interface wireless registration-table find] do={
:local R [/interface wireless registration-table get $WR rx-rate];
:local X [:pick $R 0 [:find $R "M"]]
:if ($X < "20") do={
:log warning message=("Found rx-rate=" . $X . "Mbps");
/interface wireless disable 1
/interface wireless enable 1
}
}} on-error={:log error message="script failed..."}

work like that:
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :local R [/interface wireless registration-table get $WR rx-rate];
 :local X [:pick $R 0 [:find $R "M"]] 
 :if ($X < "20") do={
 :log warning message=("Found rx-rate=" . $X . "Mbps");
 :do {/interface wireless
  set wlan1 disabled=yes;
  :delay 3s;
  set wlan1 disabled=no;
  } on-error={:log error message="failed..."}
 }
}} on-error={:log error message="script failed..."}
Last edited by ADahi on Fri Sep 07, 2018 9:34 am, edited 1 time in total.
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 1:51 am

punch Accept this answer ✔ :wink:
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :local R [/interface wireless registration-table get $WR rx-rate];
 :local X [:pick $R 0 [:find $R "M"]] 
 :if ($X < "20") do={
 :log warning message=("Found rx-rate=" . $X . "Mbps");
 #
 # your custom script here
 #
 }
}} on-error={:log error message="script failed..."}
Can work like this?

:do {
:foreach WR in=[/interface wireless registration-table find] do={
:local R [/interface wireless registration-table get $WR rx-rate];
:local X [:pick $R 0 [:find $R "M"]]
:if ($X < "20") do={
:log warning message=("Found rx-rate=" . $X . "Mbps");
/interface wireless disable 1
/interface wireless enable 1
}
}} on-error={:log error message="script failed..."}

work like that:
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :local R [/interface wireless registration-table get $WR rx-rate];
 :local X [:pick $R 0 [:find $R "M"]] 
 :if ($X < "20") do={
 :log warning message=("Found rx-rate=" . $X . "Mbps");
 :do {/interface wireless
  set wlan1 disabled=yes;
  :delay 3s;
  set wlan1 disabled=no;
  } on-error={:log error message="failed..."}
 }
}} on-error={:log error message="script failed..."}

thank you very much really!!
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 7:40 am

thank you very much really!!
I know you'd do the same for me. :wink:
Last edited by ADahi on Fri Sep 07, 2018 9:33 am, edited 1 time in total.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1302
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 8:26 am

No need to quote each others post. Makes it hard to read the thread.
Use Post Reply button at the bottom of the post.
If you need to quote, quote just the part that you need to explain.
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Fri Sep 07, 2018 9:39 am

No need to quote each others post. Makes it hard to read the thread.
Use Post Reply button at the bottom of the post.
If you need to quote, quote just the part that you need to explain.
post updated, you're right
thanks :)
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Tue Sep 11, 2018 1:55 am

Hi @ADahi You know that I was testing the script, but it is not working, when the RX falls it does run. :(
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Tue Sep 11, 2018 6:14 am

script will work if found station with rx-rate less than 20 Mbps in wireless registration table
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Tue Sep 11, 2018 7:48 pm

Hi, I put this in client cpe, and it does not work, will it take the value in another format? when the cpe falls below 20 it does not restart,
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Script to compare RX-Rate?

Tue Sep 11, 2018 8:20 pm

can you show us the output
 
cheloalb
just joined
Topic Author
Posts: 12
Joined: Fri Feb 03, 2017 11:38 am

Re: Script to compare RX-Rate?

Wed Sep 12, 2018 8:04 am

it does not show me anything in the output, it does not indicate error or anything, I paste it in the console and nothing. the equipment is a sxt lite ac

Who is online

Users browsing this forum: MSN [Bot] and 12 guests