Yet another interface check script

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:

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
}

Test:

put [$funReplace "inter=%int% and mark=con_%int%" "%int%" "ETHER1"]

Demo:
mikrotik_interface_check.gif