Using RMON to Send Traps

Problem

You want the router to send a trap when the CPU rises above a threshold, or during other important events.

Solution

You can configure a router to monitor its own CPU utilization and trigger an SNMP trap when the value exceeds a defined threshold with the following set of configuration commands (Example 1):

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#rmon event 1 log trap ORATRAP description "CPU on Router has exceeded threshold" owner ijbrown
Router(config)#rmon event 2 log description "CPU on Router has normalized" owner ijbrown         
Router(config)#rmon alarm 1 lsystem.57.0 60 absolute rising-threshold 70 1 falling-threshold 40 2 owner ijbrown
Router(config)#end
Router#

The following commands will configure the router to monitor its own buffer failures and send an SNMP trap when the number of failures exceeded a threshold (Example 2):

Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#rmon event 3 log trap ORATRAP description "Excessive buffer failures on Router" owner ijbrown   
Router(config)#rmon alarm 2 lsystem.46.0 300 delta rising-threshold 5 3 falling-threshold -1 3 owner ijbrown
Router(config)#end
Router#

To configure a router to monitor its own memory utilization and trigger an SNMP trap when it exceeded its threshold, use the following set of configuration commands (Example 3):

Router#configure terminal  Enter configuration commands, one per ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.