I am using the script below to detect and send email notifications in case of ISP assigned IPv6 prefix change on a WAN interface. I scheduled this script to run every second. ROS version is 7.1.1.
Code: Select all
:global prefix6;
:local thisip [/ipv6 dhcp-client get [find where interface=wan1] prefix];
:if ($prefix6 != $thisip) do={
/tool e-mail send to="email@email.com" subject="IPv6 Prefix Changed" body="IPv6 Prefix Changed";
set prefix6 $thisip;
}
However, this leads to my mailbox being pounded with "false alarm" email notifications saying my WAN IPv6 prefix has changed which in fact it hasn't, due to ROS pulling the ISP assigned prefix PLUS its expiry time for the "prefix" variable. As this script runs every second, I am getting 1 false alarm email per second as the expiry time keeps changing.
Code: Select all
/system script environment print
# NAME VALUE
0 prefix6 2404::/56, 21m39s
I am wondering if there's an alternative "prefix" variable which doesn't include the prefix expiry time?
Thanks!