Yet another interface check script
Posted: Thu Sep 03, 2020 10:16 pm
https://github.com/vikilpet/mikrotik-interface-check
Advantages:
- Can be used for one or more interfaces.
- Any type of interface.
- Ping several addresses (relying on one is too unreliable).
- You can run it as often as you like - it can detect fail relatively fast.
- Easy setup - you only need to set a couple of variables.
Bonus: function to replace substrings:
Test:
Advantages:
- Can be used for one or more interfaces.
- Any type of interface.
- Ping several addresses (relying on one is too unreliable).
- You can run it as often as you like - it can detect fail relatively fast.
- Easy setup - you only need to set a couple of variables.
Bonus: function to replace substrings:
Code: Select all
global funReplace do={
local s $1
while ( [typeof [find $s $2 -1]] != "nil" ) do={
local start [find $s $2 -1]
set s ( \
[pick $s 0 [$start - 1] ] \
. $3 \
. [ \
pick $s \
($start + [len $2]) \
[len $s] \
] \
)
}
return $s
}
Code: Select all
put [$funReplace "inter=%int% and mark=con_%int%" "%int%" "ETHER1"]