Restarting interface when it's down ( based on status, not the ping )

Hello everybody

I have a problem with randomly frozen the SFP>RJ45 module, it is only happening when the device connected to the PowerBox Pro sfp1 port is making reboot.
I need to log in to the MT make disable and enable Interface and it is working again properly for another couple days.
I was trying to use a script but it is not working:

:local uptime ([/interface/ethernet/monitor sfp1 once as-value]->“status”)
:local reset false
:if ([ :typeof $status ] = “no-link”) do={ :log warning “sfp1 Reset”
:set reset true }
:if ($reset = true) do={
:log warning “Resetting sfp1”
/interface disable sfp1
/delay 5s
/interface enable sfp1 }

can somebody help me please

Z.

Try manually setting the speed of the SFP port

… on both side.

The same thing I would have answered.

Is that what a resurrected cat looks like :wink:

Hi All
Maybe it’ll be useful to someone (ROSv6.49,7.15):

:local ifName sfp1

:local ifStatus ([/interface ethernet monitor [ find default-name=$ifName ] once as-value]->"status")
:if ( $ifStatus = "no-link") do={
  log warning "Resetting interface $ifName. Status=$ifStatus"
  /interface ethernet disable [ find default-name=$ifName ]
  delay 5000ms
  /interface ethernet enable [ find default-name=$ifName ]
}