You can use EEM for this. Check out the cisco beyond web site for sample scripts that may help you do this.
A company that I used to work for, www.magnus.net had a mature EEM solution for doing this for large network environments. They took a standalone router and using EEM turned it into a route monitor. It would send out notifications when BGP routes of defined attributes like AS-Path diasappeared from routing tables. It was driven by an excel spreadsheet as inputs. It was written by a super CCIE engineer.