This applet monitors CPU usage. It’s extremely useful to monitor router or switch CPU usage. If the CPU usage exceeds 70% for more than 2 minutes, it will execute the commands below, capture the output and email it to me. Be mindful that the SNMP IODs might change depending on the IOS version or hardware device:

event manager applet cpu_monitor authorization bypass
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.3.1 get-type exact entry-op gt entry-val "70" entry-type value poll-interval 120 maxrun 20
action 1.01 syslog msg "------ EEM GENERATED MESSAGE ---------"
action 1.02 syslog msg "------HIGH CPU DETECTED----, CPU:$_snmp_oid_val %"
action 1.03 cli command "enable"
action 1.04 set result ""
action 1.05 cli command "show proc cpu sorted"
action 1.06 append result "$_cli_result"
action 1.07 cli command "show proc cpu history"
action 1.08 append result "$_cli_result"
action 2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Router High CPU Usage Notification" body "$result"

courtesy of Chris Partsenidis