cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4168
Views
0
Helpful
23
Replies

Have EEM count the number of Lines

Jeffrey Simon
Level 1
Level 1

In *nix this is as simple as "wc -l" but unfortunately I can't seem to find a simple solution.  For the purposes of this thread here is my test script...

event manager applet TEST authorization bypass

event syslog pattern "TRIGGER"

action 1.0 cli command "enable"

action 2.0 cli command "conf t"

action 3.0 cli command "show log"

action 4.0 cli command "COUNT NUMBER OF LINES FROM SHOW LOG -- $_cli_result"

Can someone let me know what action 4.0 would be in order to complete this task?

Thanks!

23 Replies 23

This will eventually run on a 6k chassis with 12.2 code so unfortunately this isn't an option.  But that is good to know.  Thank you!

If you need this to run on 12.2 code on the 6500, then everything you've been doing won't work.  That code doesn't support programmatic applets.  You'll need to conver to using Tcl.  You might as well start plugging your applets into http://www.marcuscom.com/convert_applet now to get the Tcl form.

Can you please define "programmatic applets"?  EEM seems to have all of the functionality we have spoken about in this thread in the code I referenced.

Thanks.

Everything regarding regexp, foreach, if, string are only supported in EEM 3.0 and higher.  That is only available on the 6500 in 15.x code.

As far as I know, 15.x code is only available on the Sup2T for the 6500.  And that will work in the 6500-E line.

Yes.  That is what we are actually running.

Yea, we are waiting for a couple of bug fixes to be released before we put it back into prodcution. 

Thank you for all of your help. 

Review Cisco Networking for a $25 gift card