cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
827
Views
1
Helpful
5
Replies

EEM to show cli commands

This EEM script appears quite a lot online:

 

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg "$_cli_msg"

 

I've added it to three separate IOS/IOS-XE devices and it only works on one of them.
I have a C3560X running 15.2(4)E10, a C3560CX running 15.2(7)E9, a C3650 running 16.12.10a and a C891F router running 15.6(1)T3.
It only works on the C891F. On all the other devices, when I add the configuration the final line appears as this in the configuration:

 

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg ""

 

All the Catalyst switches are running the very latest images and they are all different, so I'm not convinced this is a bug. The output to 'show event manager version' shows 'Embedded Event Manager Version 4.00' on all of them.

Any ideas?

1 Accepted Solution

Accepted Solutions

Yeah, already tried all of them.  Using single quotes seems to have fixed it though.  If I enter this

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg '$_cli_msg'

The resulting configuration looks like this:

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg "'$_cli_msg'"

Which provides the CLI commands entered as per the original.

View solution in original post

5 Replies 5

action 1.0 syslog priority informational msg "$_cli_msg"

Try this add priority with level info to command and check.

Already tried that and I get this in the configuration with the same omission:

 

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog priority informational msg ""

 

Same on all three devices.  I was hoping it would work on the C3650 & C3560CX at least as these are not EoL yet and the software was only recently released for both.  The C3560X is EoL and the IOS was released over 3-years ago.

It one of three

1- "$_cli_msg"

2- $_cli_msg

3- $_syslog_msg

Try and hope one work with you 

Yeah, already tried all of them.  Using single quotes seems to have fixed it though.  If I enter this

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg '$_cli_msg'

The resulting configuration looks like this:

event manager applet catchall
 event cli pattern ".*" sync no skip no
 action 1 syslog msg "'$_cli_msg'"

Which provides the CLI commands entered as per the original.

Happy ends 

Have a nice day

MHM

Review Cisco Networking for a $25 gift card