Maybe someone knows a easy way and will tell us but there are 2 ways I suspect it can be done. I have not done this particular item.
First you could attempt to use the RMON command. This is a internal event monitor and can cause snmp traps and other actions based on changes in MIB variables. The challenge here is finding the correct MIB and then figuring out what name this command want you to call it. In most cases anything that can be displayed with a command you can find a mib for if you dig long enough with a MIB browser.
The new toy that I know can do it if you are brave enough is called Embedded Event Manager.
They have been adding a lot of features to this in the last few IOS releases. Since this is all based on scripts you can issue just about any command and take action based on the output. There are huge libraries of scripts for samples. This link is the best I have seen. This was a presentation from the cisco users group in dallas a couple of months ago.
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...