cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1784
Views
0
Helpful
3
Replies

Help with custom EEM (collect top)

akieser
Level 1
Level 1

So ... whats wrong with this ? lol

event manager environment quote "

event manager applet top-interface-counter

event cli pattern "topint" sync yes

action 1 cli command "collect top 10 counters interface all interval 10"

action 2 cli command "event manager applet int-pause"

action 2.1 cli command "enable"

action 2.2 cli command "event timer countdown time 11"

action 2.3 cli command "action 1.0 cli command $quoteshow top counters interface report 1"

action 2.4 cli command "action 2.0 cli command $quoteno event manager applet int-pause"

action 2.5 cli command "action 3.0 cli command end"

action 3 cli command "event manager applet int-clear"

action 3.1 cli command "enable"

action 3.2 cli command "event timer countdown time 3"

action 3.3 cli command "action 1.0 cli command $quote clear top counters interface report"

action 3.4 cli command "action 2.0 cli command $quote no event manager applet int-clear"

action 3.5 cli command "action 3.0 cli command end"

action 4 cli command "end"

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

First, is there an existing command in IOS with "topint" in its structure?  If not, this will fail outright.  You'd need to change the event line to:

event cli pattern "topint" enter

Next, you must put a space between $quote and the start of your command and add another $quote at the end of the command:

action 2.3 cli command "action 1.0 cli command $quote show top counters interface report 1$quote"

Next, you do not enter "config t" mode before you configure your nested applets.  You need to add:

action 2.11 cli command "config t"

You'll also need to enter "config t" mode in your nested applets in order to remove the EEM policies.

Finally, action 3.1 can be deleted.

Thanks for the quick reply

Sorry noticed the small typo's wrote it in a hurry.

event cli pattern "topint" enter

I wanted when someone enter's "topint" in CLI it will run the script.

Then you will need to change the event line has I have shown.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco