Cisco Command Christmas Calendar #4: logging synchronous / no exec-timeout

Today's post unveils a handy little command combo, especially for troubleshooting scenarios and lab environments. The logging synchronous command is useful for keeping system messages from interrupting your typing. By default, messages will appear immediately when they are processed by the system, and the CLI cursor will appear at the end of the displayed message. For example, the "Configured by console from console" message can appear in the middle of the command you're currently typing. The logging synchronous command allows you to avoid these potentially annoying interruptions without having to turn off logging to the console entirely. When this command is enabled, unsolicited messages and debug output are displayed on a separate line after user input. After the unsolicited messages are displayed, the CLI also returns to a new line. This is very useful to continue typing when debugging is enabled.

Before logging synchronous is enabled:

Router(config-line)# end
Router# show ru
2w1d: %SYS-5-CONFIG_I: Configured from console by consolenning-config

The "Configured from console by console" message annoyingly disrupts the show running-config command.

The logging synchronous command is enabled under line console 0 as follows:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# line console 0 
Router(config-line)# logging synchronous

After logging synchronous is enabled:

Router(config-line)# end
Router# show ru
2w1d: %SYS-5-CONFIG_I: Configured from console by console
Router# show running-config

Now the show running-config command is shown fully on a new line.

The exec-timeout command sets the interval that the command line will wait for user input. If no input is detected in that time, the terminal is returned to the idle state and the session is disconnected. By default, the EXEC timer is set to 10 minutes. The no exec-timeout command removes any time restrictions. This is a handy little trick when you're labbing and don't want to type the username/password and enable command every 10 minutes of inactivity. This should obviously not be done in production. The exec-timeout 0 0 command effectively sets the timeout to 0 minutes and 0 seconds (infinity), so it is equivalent to the no exec-timeout command.

Router(config)# line console 0
Router(config-line)# no exec-timeout

Router(config)# line console 0
Router(config-line)# exec-timeout 0 0


Cisco documentation: logging synchronous and no exec-timeout

Comments