Community discussions

just joined
Topic Author
Posts: 1
Joined: Fri Nov 16, 2018 1:04 am

Set value based on vrrp status

Fri Nov 16, 2018 2:26 am


I try to create a script that sets a variable if vrrp interface number 1 is master but I don't know how to create an if statement if master=yes or backup=yes.

I tried the following snippet:
:local Backup [/interface vrrp find backup=yes name=ether1-VRRP]
:local Master [/interface vrrp find master=yes name=ether1-VRRP]

:if ($Backup) do={ :local vrrpState backup }
:if ($Master) do={ :local vrrpState master }

I also tried a few different approaches but haven't saved them (e.g. variations with get).

Is this possible? I would prefer a solution based on id rather name.

Kind Regards,

Who is online

Users browsing this forum: No registered users and 2 guests