:local txc
:local txcA
:local txcB
:local txcC
:local rxc
:local rxcA
:local rxcB
:local rxcC
:local rxta
:local rxtaA
:local rxtaB
:local rxtaC
:local txta
:local txtaA
:local txtaB
:local txtaC
:local sysname [/system identity get name]
:local datetime “$[/system clock get date] $[/system clock get time]”
:log info “Bandwidth-test start”
/tool bandwidth-test 192.168.50.1 protocol=udp direction=both duration=30s user=usuário password=senha do={
:set txcA ($“tx-current” / 1000)
:set txcB ($txcA / 1000 * 1000)
:set txcC ($txcA - $txcB)
:set txcB ($txcB / 1000)
:set txc “$txcB.$txcC”
:set rxcA ($“rx-current” / 1000)
:set rxcB ($rxcA / 1000 * 1000)
:set rxcC ($rxcA - $rxcB)
:set rxcB ($rxcB / 1000)
:set rxc “$rxcB.$rxcC”
:set rxtaA ($“rx-total-average” / 1000)
:set rxtaB ($rxtaA / 1000 * 1000)
:set rxtaC ($rxtaA - $rxtaB)
:set rxtaB ($rxtaB / 1000)
:set rxta “$rxtaB.$rxtaC”
:set txtaA ($“tx-total-average” / 1000)
:set txtaB ($txtaA / 1000 * 1000)
:set txtaC ($txtaA - $txtaB)
:set txtaB ($txtaB / 1000)
:set txta “$txtaB.$txtaC”
}
:log info “Bandwidth-test done, sending info by e-mail”
/tool e-mail send to=“xxxx@hotmail.com” from=“xxxx@hotmail.com” user=“xxxx@hotmail.com” password=“sua sennha” server=65.55.172.254 subject=“Teste velocidade backbone : $sysname” body=“$sysname \n $datetime \n \n Resultado : \n TX speed $txc Mbps/s \n RX speed $rxc Mbps/s \n \n TX total average $txta Mbps/s \n RX total average $rxta Mbps/s”