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 "[email protected]" from "[email protected]"
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
Time Registered
Name
1
applet
snmp
Thu Jan30
05:57:16 2003
memory-demo
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)
1747
Configuration Examples for Writing Embedded Event Manager Policies Using Tcl
Summary of Contents for Catalyst 2960 Series
Page 96: ......
Page 196: ......
Page 250: ......
Page 292: ......
Page 488: ......
Page 589: ...P A R T VI Cisco Flexible NetFlow Configuring NetFlow Lite page 509 ...
Page 590: ......
Page 619: ...P A R T VII QoS Configuring QoS page 539 Configuring Auto QoS page 645 ...
Page 620: ......
Page 750: ......
Page 1604: ......
Page 1740: ......
Page 2105: ...P A R T XII Configuring Cisco IOS IP SLAs Configuring Cisco IP SLAs page 2025 ...
Page 2106: ......
Page 2118: ......
Page 2164: ......