Hi,
The VRRP interfaces have an "on-master"/"on-backup" script trigger.
Is there a variable that specifies the vrrp interface that triggered the script?
Kind regards,
Ton
:global thearray [:toarray ""]
:foreach item in=[/interface vrrp find] do={
:local iname [/interface vrrp get $item name]
:set ($thearray->$iname) "unset"
}
:global thearray
:set ($thearray->"vrrp1234") "master"
/system script run vrrphaschanged
:global thearray
:foreach item,value in=$thearray do={
:local vrname $item
:local status $value
:if ($status = "master") do={
:log info "$vrname is now $status"
# place here what you want to do if vrrp is on master status
# you done it, set again unset for not execute again on next call
:set ($thearray->$item) "unset"
}
:if ($status = "backup") do={
:log info "$vrname is now $status"
# place here what you want to do if vrrp is on backup status
# you done it, set again unset for not execute again on next call
:set ($thearray->$item) "unset"
}
}