Community discussions

MUM Europe 2020
 
cumhureren
just joined
Topic Author
Posts: 2
Joined: Wed Jan 22, 2020 1:29 pm

Mikrotik Bandwidth test scriptting

Wed Jan 22, 2020 1:37 pm

hi everyone
i am new at mikrotik scripting

i have a problem for this script. CODE 1 script is working well it sends telegram message to me but i am tying to convert this code if bandwidth test result lower then 7 send message to me if not dont send any message. i tried in CODE 2 but it doesnt work. can u have any ideas for this

Thanx for your help

CODE1


:local rxta
:local rxtaA
:local rxtaB
:local rxtaC
/tool bandwidth-test 5.5.5.1 protocol=tcp direction=receive duration=10s user=cemil.bakir@mernet password=cemil.bakir do={
:set rxtaA ($"rx-total-average" / 1000)
:set rxtaB ($rxtaA / 1000 * 1000)
:set rxtaC ($rxtaA - $rxtaB)
:set rxtaB ($rxtaB / 1000)
:set rxta "$rxtaB.$rxraC"
/tool fetch keep-result=no url="https://api.telegram.org/xxxxxxxxxxxxx: ... STERI-TEST $rxta Mbps "


CODE 2

:local rxta
:local rxtaA
:local rxtaB
:local rxtaC
/tool bandwidth-test 5.5.5.1 protocol=tcp direction=receive duration=10s user=cemil.bakir@mernet password=cemil.bakir do={
:set rxtaA ($"rx-total-average" / 1000)
:set rxtaB ($rxtaA / 1000 * 1000)
:set rxtaC ($rxtaA - $rxtaB)
:set rxtaB ($rxtaB / 1000)
:set rxta "$rxtaB.$rxraC"
:set hiz “8”


:if ($rxta!<= ($hiz) do={
/tool fetch keep-result=no url="https://api.telegram.org/xxxxxxxxxxxxx: ... STERI-TEST $rxta Mbps "
}
 
sopyan0807
newbie
Posts: 25
Joined: Wed Jan 22, 2020 5:21 pm
Contact:

Re: Mikrotik Bandwidth test scriptting

Sun Jan 26, 2020 11:52 am

You can try to use logic
:if ($rxta < "7") do={
and remove variables "hiz"
 
cumhureren
just joined
Topic Author
Posts: 2
Joined: Wed Jan 22, 2020 1:29 pm

Re: Mikrotik Bandwidth test scriptting

Sat Feb 15, 2020 11:14 am

no :(
it does not work

do ypu have any idea someone?

Who is online

Users browsing this forum: No registered users and 21 guests