Post · 2 min read· pp. 46–47

CLI command logging without TACACS+

Tuesday, November 7, 2006 15:56 +0100

CLI command logging without TACACS+

The Cisco IOS’s AAA architecture contains many handy features, including authorizing and logging every CLI command executed on the router. Unfortunately, the AAA command accounting only supports TACACS+ as the AAA transport protocol, making it unusable in RADIUS environments.

You can use Embedded Event Manager as a workaround. The following configuration commands will log every command executed on the router.

text
event manager applet CLIaccounting
 event cli pattern ".*" sync no skip no
 action 1.0 syslog priority informational msg "$_cli_msg"
 set 2.0 _exit_status 1

The log messages generated by this EEM applet have the following format:

text
%HA_EM-6-LOG: CLIaccounting: *command*

As the EEM uses standard IOS logging mechanisms, you can use the show logging command to examine the command execution history or store the messages on a syslog server.

Note: As a side effect, all commands executed on a router will be echoed to the router’s console unless you turn off console logging with the no logging console command or use TCL-based syslog filters (more about them in an upcoming post).

diagram diagram diagram diagram