0% found this document useful (0 votes)
61 views

EEM Script

The document describes three Event Manager Applets (EEM) that can be used to: 1) Automatically flap an interface every 30 seconds by shutting it down for 10 seconds and bringing it back up 2) Intercept "write" commands and spoof the output before reloading the device 3) Create an interactive menu without using the "menu" command to shut down or bring up a frame interface

Uploaded by

PA2 kspl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

EEM Script

The document describes three Event Manager Applets (EEM) that can be used to: 1) Automatically flap an interface every 30 seconds by shutting it down for 10 seconds and bringing it back up 2) Intercept "write" commands and spoof the output before reloading the device 3) Create an interactive menu without using the "menu" command to shut down or bring up a frame interface

Uploaded by

PA2 kspl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Every 30 seconds, shut down the Fa0/0 interface, wait 10 seconds, and bring it back.

event manager applet FLAP


event timer watchdog time 30
action 1 cli command "enable"
action 100 cli command "config t"
action 101 cli command "interface Fa0/0"
action 102 cli command "shut"
action 103 wait 10
action 104 cli command "no shut"

Intercept attempts to use the “write” commands, spoof some output, and then reload the device.

event manager applet NOSAVE


event cli pattern "write" sync yes
action 111 puts "Building configuration..."
action 112 wait 5
action 113 puts "[OK]"
action 114 set _exit_status "0"
action 115 reload

Using EEM to create an IOS menu without using the “menu” command.

username MYUSER secret cisco


username MYUSER priv 15
username MYUSER autocommand MN
alias exec MN event manager run MYNOC
event manager applet MYNOC
event none
action 0 puts ""
action 1 puts "1 Shutdown Frame Interface"
action 2 puts "2 Bring up Frame Interface"
action 3 gets opt
action 4 if $opt eq 1 goto 800
action 5 if $opt eq 2 goto 900
action 6 if $opt ne 2 goto 1
action 800 puts "Shutting Down Frame"
action 801 cli command "enable"
action 802 cli command "config term"
action 803 cli command "interface Ser0/0/0"
action 804 cli command "shut"
action 805 cli command "end"
action 806 cli command "wr mem"
action 850 exit
action 900 puts "Bringing up Frame"
action 901 cli command "enable"
action 902 cli command "config term"
action 903 cli command "interface Ser0/0/0"
action 904 cli command "no shut"
action 905 cli command "end"
action 906 cli command "Wr mem"
action 950 exit

You might also like