For the purpose of this example, a memory depletion is forced on the device, and a series of
show memory
commands are executed to watch the memory deplete:
Device#
show memory
Head
Total(b)
Used(b)
Free(b)
Lowest(b)
Largest(b)
Processor
53585260
212348444
119523060
92825384
92825384
92365916
Fast
53565260
131080
70360
60720
60720
60668
Device#
show memory
Head
Total(b)
Used(b)
Free(b)
Lowest(b)
Largest(b)
Processor
53585260
212364664
164509492
47855172
47855172
47169340
Fast
53565260
131080
70360
60720
60720
60668
Device#
show memory
Head
Total(b)
Used(b)
Free(b)
Lowest(b)
Largest(b)
Processor
53585260
212369492
179488300
32881192
32881192
32127556
Fast
53565260
131080
70360
60720
60720
60668
When the threshold is reached, an EEM event is triggered. The applet named memory-demo runs, causing a
syslog message to be written to the console and a switch to be made to the secondary RP. The following
messages are logged:
00:08:31: %HA_EM-2-LOG: memory-demo: Memory exhausted; current available memory is
4484196 bytes
00:08:31: %HA_EM-6-FMS_SWITCH_HARDWARE: fh_io_msg: Policy has requested a hardware
switchover
The following is partial output from the
show running-config
command on both the primary RP and the
secondary (redundant) RP:
redundancy
mode sso
.
.
!
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
SNMP Notification Event Detector
The following example shows how to configure the
snmp-server community
public RW and
snmp-server
manager
commands before
event snmp-notification
is configured.
snmp-server community public RW
snmp-server manager
The following example shows how an EEM applet called SNMP_Notification is being registered to run an
EEM script when the device receives an SNMP notification on destination IP address 192.168.1.1 for object
ID 1 whose value equals 10.
event manager applet SNMP_Notification
event snmp-notification dest_ip_address 192.168.1.1 oid 1 op eq oid-value 10
action 1 policy eem_script
Syslog Event Detector
The following example shows how to specify an EEM applet to run when syslog identifies that Ethernet
interface 1/0 is down. The applet sends a message about the interface to syslog.
event manager applet interface-down
event syslog pattern
“
.*UPDOWN.*Ethernet1/0.*
”
occurs 4
action 1.0 syslog msg "Ethernet interface 1/0 changed state 4 times"
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1748
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: ......