I want to make skript, which will do bandwitch test and if throughoutput will be less than X it will send me email.
I have this 2 scripts, If I run it separately they run without problem.
But If I run skript2 using skript1 it will start, but didnt log message.
Script1:
/tool bandwidth-test 10.x.x.x protocol=tcp tcp-connection-count=20 direction=receive duration=12s user=xxx password=xxx do={
:if ($status="running") do={
/system script run script2;
:delay 11s
}
}
script2:
:local bitps
:local vysledek
:set vysledek 1
:for i from=1 to=2 do={
/interface monitor-traffic ether1 interval=2s do={:set bitps (rx-bits-per-second)} once
if ($bitps < 10000000) do={
:set vysledek 0;
} else={
}
:delay 1s
}
if ($vysledek = 1) do={
:log warning "rychlost nad 10M"
what can be wrong?