Hello,
depending on the routing platform you can use ip sla or rtr object to track reachability of a next hop that is similar
see
http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_pi2.html#wp1012541
set ip next-hop verify-availability [next-hop-address sequence track object]
for example multilayer switches like C4500 don't support this.
Hope to help
Giuseppe