E-mail notification. Recursive routing

Hi all. I am using recursive routing for 3 ISPs. I would like to know when a provider switch occurs (email notification). However, with recursive routing, I can’t figure out how to implement it. Ask the community for help

Comments on routes, that’s all I can catch on, but how can you understand that the route has changed to one or another provider ?
Screenshot_1.png

I found such a piece of code on the forum (for 2018)

{
:global prevstatus;
:global status [:ip route get value-name=active [:ip route find comment="3.  Recursive lookup for Virgin connection (Via WAN routing table)"]]
:if ( "$status" != "$prevstatus" ) do={
:log warn "Virgin gateway changed status from \"$prevstatus\" -> \"$status\" (true=up, false=down, nothing=unintialized)";
:tool e-mail send to=user1@jdomain1.com subject="Virgin WAN gateway changed status" body=( [ :system clock get date ] . " " . [ :system clock get time ] . " gateway changed status from \"$prevstatus\" -> \"$status\" (true=up, false=down, nothing=unintialized)" )
:tool e-mail send to=user2@domain2.com subject="Virgin WAN gateway changed status" body=( [ :system clock get date ] . " " . [ :system clock get time ] . " gateway changed status from \"$prevstatus\" -> \"$status\" (true=up, false=down, nothing=unintialized)" )
}
:global prevstatus $status
}

however there are two questions

  1. This was relevant for version ROS 6 (now I’m using ROS7 maybe there are new tools?)
  2. When using this script, I do not get the “false” status of the route. An empty space is passed to the quotes.