Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 

example of Embedded Event Manager (EEM) on my 881W - to shut down a interface at 1am

Hi Keith

I will use the Cisco community as a repository for my answer to your question on event manager. Gotta admit I am not using the most current version of router IOS. 

Cisco IOS Software, C800 Software (C800-UNIVERSALK9-M), Version 15.3(3)M, RELEASE SOFTWARE (fc2)

in my example i am using a real world example of a problem that really annoyed me.

I have  a ATA (for phone connectivity)  connected to interface  FastEthernet0 of my ISR881W.  

I got sick of getting phantom/anonymous calls at weird hours of the morning, so i setup a simple Embedded Event Manager (EEM)  script to shut down FastEthernet 0 at 1am.

 

Also set up another script to enable the interface  at 7am. 

 I really don't want phone calls between the hours of  1am to 7am .

The IOS documentation mentioned the need to create a couple of extra vty interfaces for both of my CLI scripts, I just added, because I was lazy; line vty 5 15.  Not sure why cisco couldn't allow for the CLI commands without creating extra vty interfaces"

But suffice to say, I am only using a very limited subset of EEM commands. Lots of tremendous functionality with many examples at cisco.com

 

event manager applet ATAon
 event timer cron name ATAon cron-entry "00 7 * * 1-7"
 action 1.0 cli command "enable"
 action 1.1 cli command "config t"
 action 1.2 cli command "interface  fastEthernet 0"
 action 1.3 cli command "no shut"
 action 1.4 cli command "exit"
event manager applet ATAoff
 event timer cron name ATAoff cron-entry "00 1 * * 1-7"
 action 1.0 cli command "enable"
 action 1.1 cli command "config t"
 action 1.2 cli command "interface fastEthernet 0"
 action 1.3 cli command "shut"
 action 1.4 cli command "exit"

!

If i try to manually run the script,  i get an errior as shown below, not very descriptive . 

Raleigh#event manager run applet ATAon
EEM policy applet not registered with event none Event Detector

 But at 1am fastEthernet 0 DOES shutdown. So my only way to test the functionality was to manually alter the time in the script  and watch the LED corresponding to FastEthernet 0 or the console interface messages.

Hope this example is useful, it made my household a little quieter at the wee early hours and ties me to a 881W with this pseudo triggering functionality

regards Dave

 

Version history
Revision #:
1 of 1
Last update:
‎04-30-2014 11:48 PM
Updated by:
 
Labels (1)
Comments
New Member

Hi keith,

 

There must be a bug or I screwed up , the Commands work most of the time, but I have noticed where the switch port didn't enable occasionally...I as forced to delete the script as it must work perfectly.

New Member

Hello

 

Im looking to set up a similar thing but I'm using a Cisco 1921 router using this version of code

C1900-universalk9-m version 15.4 (1) t1

How can I work out which license or applet you need to get the EEM feature to work??

 

please help