Hi All,
I’m looking for a script to email me an IP address of an interface. I know there are few scripts around, but there’s a catch:
The interface is disabled druing normal operation. It’s being enabled only when the box becomes VRRP master.
Hmm, I actually did it by myself.
If anyone will be in a similar need, paste this in the VRRP ‘On Master’ script (change VLAN1 to the interface of your interest as it appears in ‘/ip address print’):
# Get the IP address of an interface
:global wanxipaddr [/ip address get [find where interface=VLAN1] address];
# Send a notification email
/tool e-mail send to="your@email.com" subject="VRRP MASTER" body="VRRP switched to MASTER\nIP address: $wanxipaddr"
:log info "VRRP change notification email sent (MASTER).";