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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Help with custom EEM (collect top)

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
Cisco Employee

Help with custom EEM (collect top)

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.

New Member

Help with custom EEM (collect top)

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.

Cisco Employee

Help with custom EEM (collect top)

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

613
Views
0
Helpful
3
Replies