{
:local stahovanie
:local vysledokst
:local odosielanie
:local vysledokup
:local thisbox [/system identity get name]
:local thistime [/system clock get time]
:local startupozornenietext "bod A"
:local cielupozornenietext "bod B"
:local upozorneniedownrychlost "35M(20tcp)"
:local hranicadownrychlost "35000000"
:local downmaximalnahranica "40M"
:local upozornenieuprychlost "25M(20tcp)"
:local hranicauplrychlost "25000000"
:local uplmaximalnahranica "30M"
:local iproutra "10.x.x.x"
:local ethsledovania "wlan3"
/tool bandwidth-test address=$iproutra protocol=tcp direction=receive tcp-connection-count=20 remote-tx-speed=$downmaximalnahranica user=xxx password=aaa duration=30s do={
:if ($status="running") do={
{
:delay 4s
/interface monitor-traffic $ethsledovania once do={:set stahovanie (rx-bits-per-second)}
:if ($stahovanie > $hranicadownrychlost ) do={
:set vysledokst "0"} else={:set vysledokst "1"}
:delay 1s
}
}
}
:if ($vysledokst = "1") do={
/tool e-mail send to="xxx@gmail.com" subject=" POZOR Down $startupozornenietext<$cielupozornenietext pod $upozorneniedownrychlost $thistime test z: $thisbox ";
/tool e-mail send to="aaa@gmail.com" subject=" POZOR Down $startupozornenietext<$cielupozornenietext pod $upozorneniedownrychlost $thistime test z: $thisbox ";
/tool e-mail send to="bbb@gmail.com" subject=" POZOR Down $startupozornenietext<$cielupozornenietext pod $upozorneniedownrychlost $thistime test z: $thisbox ";
}
:delay 300s
{
/tool bandwidth-test address=$iproutra protocol=tcp direction=transmit tcp-connection-count=20 local-tx-speed=$uplmaximalnahranica user=xxxx password=aaa duration=30s do={
:if ($status="running") do={
{
:delay 4s
/interface monitor-traffic $ethsledovania once do={:set odosielanie (tx-bits-per-second)}
:if ($odosielanie > $hranicauplrychlost ) do={
:set vysledokup "0"} else={:set vysledokup "1"}
:delay 1s
}
}
}
:if ($vysledokup = "1") do={
/tool e-mail send to="xxx@gmail.com" subject="POZOR UP $startupozornenietext>$cielupozornenietext pod $upozornenieuprychlost $thistime $thisbox ";
/tool e-mail send to="aaa@gmail.com" subject="POZOR UP $startupozornenietext>$cielupozornenietext pod $upozornenieupychlost $thistime $thisbox ";
/tool e-mail send to="bbb@gmail.com" subject="POZOR UP $startupozornenietext>$cielupozornenietext pod $upozornenieuprychlost $thistime $thisbox ";
}
}
}
ak bude mat niekto navrh na zlepsenie, popripade bude chciet nieco vysvetlit rad vysvetlim...
spusta to btest, najprv download, po 5 minutach upload, sleduje interface, kde ak padne pod urcitu rychlost posle email....