SNMP Event Detector
The following example shows how to specify an EEM applet to run when the CPU usage is greater than 75
percent. When the EEM applet runs, the CLI commands enable and show cpu processes are run, and an
e-mail containing the result of the show cpu processes command is sent to an engineer.
event manager applet snmpcpuge75
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.3.1 get-type exact entry-op ge entry-val 75
poll-interval 10
action 1.0 cli command "enable"
action 2.0 cli command "show process cpu"
action 3.0 mail server "192.168.1.146" to "engineer@cisco.com" from "devtest@cisco.com"
subject "B25 PBX Alert" body "$_cli_result"
The next example is more complex and shows how to configure an EEM applet that causes a switch to the
secondary (redundant) Route Processor (RP) when the primary RP runs low on memory.
This example illustrates a method for taking preventative action against a software fault that causes a memory
leak. The action taken here is designed to reduce downtime by switching over to a redundant RP when a
possible memory leak is detected.
The figure below shows a dual RP device that is running an EEM image. An EEM applet has been registered
through the CLI using the event manager applet command. The applet will run when the available memory
on the primary RP falls below the specified threshold of 5,120,000 bytes. The applet actions are to write a
message to syslog that indicates the number of bytes of memory available and to switch to the secondary RP.
Figure 110: Dual RP Topology
The commands used to register the policy are shown below.
event manager applet memory-demo
event snmp oid 1.3.6.1.4.1.9.9.48.1.1.1.6.1 get-type exact entry-op lt entry-val 5120000
poll-interval 90
action 1.0 syslog priority critical msg "Memory exhausted; current available memory is
$_snmp_oid_val bytes"
action 2.0 force-switchover
The registered applet is displayed using the show event manager policy registered command:
Device# show event manager policy registered
No.
Type
Event Type
1
applet
snmp
oid {1.3.6.1.4.1.9.9.48.1.1.1.6.1} get-type exact entry-op lt entry-val {5120000}
poll-interval 90
action 1.0 syslog priority critical msg "Memory exhausted; current available memory is
$_snmp_oid_val bytes"
action 2.0 force-switchover
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
Configuration Examples for Writing Embedded Event Manager Policies Using Tcl
Time Registered
Thu Jan30
05:57:16 2003
Name
memory-demo
1747