So since the CRS3XX series switches do not really do loop protect and ive tested the storm control feature and it does not work good at all. I thought of asking the Globally hated ChatGPT to check logs for a message with “probably a loop” and then act on that message and so far it seems to disable the interface whenever the issue arises.
Thoughts ANYONE lol..
Thank you ..
:local loopMessage "probably a loop";
:local foundLogs [/log find message~"$loopMessage"];
# Loop through all found log entries
:foreach logId in=$foundLogs do={
:local thisMessage [/log get $logId message];
# Assume interface name follows immediately after "ether" and goes until the first space
:local startIdx [:find $thisMessage "ether"];
:local endIdx [:find $thisMessage " " startIdx];
:local thisInterface "";
# Check if "ether" is found and adjust endIdx if not found (i.e., end of message)
if ($endIdx = -1) do={
:set endIdx [:len $thisMessage];
}
:set thisInterface [:pick $thisMessage $startIdx $endIdx];
# Check if the interface name is extracted correctly and exists
:if ([:len [/interface find name=$thisInterface]] > 0) do={
:log info ("Loop detected, shutting down interface: " . $thisInterface);
/interface set [find name=$thisInterface] disabled=yes;
}
}