Get rate on interface

Hi,

i wont get the rate of an interface (ether1)

if the rate is not 1Gbps , only 100M, then the interfae should be shut down an 1sec later shut be up.

have you any suggestions?

How can I be the “rate” from “monitor” get?

:put [/interface/ethernet/get rate ether1]

or

/interface/ethernet/get rate ether1

will not work

thanks

You cannot get rate from get as it's dynamic, so you need monitor once to get it. For example,

:put ([/interface/ethernet/monitor ether13 once as-value]->"rate") 

1Gbps

You can check and do it...

:local if "ether1"

/interface ethernet
:if (([monitor $if once as-value]->"rate") != "1Gbps") do={
    disable $if
    :delay 1s
    enable $if
}

...but if it doesn't go back to 1Gbps for some reason... it's always disconnecting and reconnecting...

:local if "ether1"

/interface ethernet
:if (([monitor $if once as-value]->"rate") != "1Gbps") do={
    disable $if
    :delay 1s
    enable $if
    :delay 10s
    :if (([monitor $if once as-value]->"rate") != "1Gbps") do={
        # disable scheduler here...
    }
}