mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-08-02 00:54:47 +02:00
Update.
This commit is contained in:
parent
0f3f4a1950
commit
50874b1760
3 changed files with 89 additions and 0 deletions
22
RouterOS_Reset_Interface.rsc
Normal file
22
RouterOS_Reset_Interface.rsc
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue