This commit is contained in:
Grzegorz Budny 2019-08-03 10:48:07 +02:00
parent 0f3f4a1950
commit 50874b1760
3 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,22 @@
# RouterOS Function
# Copyright (c) Grzegorz Budny
# Reset interface if particular IP does not respond
:global ResetInterface do={
:if ([/ping $ipAddress interval=1 count=4] > 0) do={
:log info "...:::Interface healthcheck. Status OK:::..."
}\
else={
:log error ("...:::Monitor detected ".$interfaceName." down. Resetting:::...");
/interface ethernet disable $interfaceName;
:delay 3;
/interface ethernet enable $interfaceName;
}
}
$ResetInterface ipAddress=ipAddress_To_Monitor interfaceName=interface_name;