Друзья, использую скрипт:
/interface monitor-traffic [/interface find name=lte1] once do={
:local RX (rx-bits-per-second / 1024);
:local TX (tx-bits-per-second / 1024);
:put $RX;
:put $TX;
:if ($RX+$TX < 10) do={
:log info message="Low traffic on lte1. Ping ON";
:local PINGCOUNT 1;
:local PINGIP "
8.8.8.8";
:local PINGIP1 "
77.88.8.8";
:local PINGRESULT ([/ping $PINGIP count=$PINGCOUNT]+[/ping $PINGIP1 count=$PINGCOUNT]);
:if ($PINGRESULT > 0) do={
} else={
:log info message="PINGTEST FAIL";
:log info message="Disable LTE";
:interface disable lte1;
:delay 3s;
:log info message="Enable LTE";
:interface enable lte1;
#log info message="Script END";
}
} else={
}
}
Хочу использовать только для RX, для этого удаляю 2 строки и одну правлю, получается так:
/interface monitor-traffic [/interface find name=lte1] once do={
:local RX (rx-bits-per-second / 1024);
:put $RX;
:if ($RX < 10) do={
:log info message="Low traffic on lte1. Ping ON";
:local PINGCOUNT 1;
:local PINGIP "
8.8.8.8";
:local PINGIP1 "
77.88.8.8";
:local PINGRESULT ([/ping $PINGIP count=$PINGCOUNT]+[/ping $PINGIP1 count=$PINGCOUNT]);
:if ($PINGRESULT > 0) do={
} else={
:log info message="PINGTEST FAIL";
:log info message="Disable LTE";
:interface disable lte1;
:delay 3s;
:log info message="Enable LTE";
:interface enable lte1;
#log info message="Script END";
}
} else={
}
}
Но при таком написании условие срабатывает всегда, какое бы значение не стояло, всегда получаю "Low traffic on lte1. Ping ON". Почему так происходит?