Hi, this script work fine in mikrotik 2.9.45, but when upgrade to 3.0rc2 don´t work
This is the script:
/interface monitor-traffic [/interface find name “wds1”] once do {
:if ($sent-bits-per-second < 20000) do {
/queue simple remove [/queue simple find interface=“ether1”]
:log warning “Traffic limit removed for ip address/network/interface”
}
}
Thanks…
Gerard
2
Try this.. Haven’t tested it..
/interface monitor-traffic [/interface find name="wds1"] once do={
:if ( $"sent-bits-per-second" < 20000 ) do={
/queue simple remove [/queue simple find interface="ether1"]
:log info "Traffic limit removed for ip addres/network interface"
}
}
-Gerard
ok, thank. i have 2 scripts more…
one is:
:if ([/system clock get time] = 03:50:00) do {/system shutdown :log info “APAGADO AUTOMATICO”
}
}
and the last is:
/interface monitor-traffic [/interface find name “wds1”] once do {
:if ($sent-bits-per-second > 20000 ) do {
/queue simple add name=(username . “_” . [:pick [/system clock get date] 4 6] . “-” . [:pick [/system clock get date] 0 3]
. “-” . [:pick [/system clock get date] 7 11] . “-” . [:pick [/system clock get time] 0 9]) limit-at=5000/15000
max-limit=5000/15000 interface=“ether1” priority=1
:log warning “Traffic limit added for ip address/network/interface”
}
}
Thanks…
Gerard
4
Hope these work.. I’m going to bed.. Scripts in 3.0 are very similar.. Variables are in quotes ie $“variable” and do is now do=
You can also type these in on the command line and it will highlight in different colors if it is correct or not..
-Gerard
:if ([/system clock get time] = "03:50:00") do={
:log info "APAGADO AUTOMATICO";
/system shutdown;
}
/int monitor-traffic [/interface find name="wds1"] once do={
:if ($"sent-bits-per-second" > 20000 ) do={
/queue simple add name=(username . "_" . [:pick [/system clock get date] 4 6] . "-" . [:pick [/system clock get date] 0 3] . "-" . [:pick [/system clock get date] 7 11] . "-" . [:pick [/system clock get time] 0 9]) limit-at=5000/15000 max-limit=5000/15000 interface="ether1" priority=1
:log warning "Traffic limit added for ip address/network/interface"
}
}
Ok, thank you very much for all and the fast reply…