Control Console and Terminal Logging in Cisco Router and Switches

This item was filled under [ Cisco ]

You might have experienced that while you are typing a command on a terminal, some stuff get thrown to the terminal by the router or the switch making it a mess. This stuff can be useful specially when you are configuring a routing protocol or changing setting on an interface. However messages like the following, is quite disturbing when you are doing some task.

View Code SHELL
1
2
3
4
5
6
7
8
9
Router(config)#
Router#show
*Mar  1 00:07:23.487: %SYS-5-CONFIG_I: Configured from console by
consolerun
Building configuration...
 
Current configuration : 694 bytes
!
version 12.3

Above terminal output is a good example. A message has been thrown in between me “show run” command. The router understood the command perfectly, but it we cat read it clearly. The reason for this is logging. Routers and switches use console ports to log messages. You can three options to stop or minimize the logging disturbances on terminals.

Disable Logging Completely

This method is quite straight forward and you’ll loose the ability to see what’s going on in the router while you are configuring. You might want to know when a network interface goes up or down, neighbor relationship formation, etc. So this is the least useful method, but you do not get any messages on your console.

View Code SHELL
1
Router(config)#no logging consol

Configure Logging Levels

Cisco routers, switches, PIX and ASA firewalls prioritize log messages into 8 levels.

View Code SHELL
1
2
3
4
5
6
7
8
9
Level	Level Name		Description
0  	Emergencies  		System is unusable
1 	Alerts 			Immediate action needed
2 	Critical 		Critical conditions
3 	Errors 			Error conditions
4 	Warnings 		Warning conditions
5 	Notifications 		Informational messages
6 	Informational 		Normal but significant conditions
7 	Debugging 		Debugging messages

Log messages with lower numbers are more critical than higher numbers. If you specify a level, let say Warnings all the messages belong to that level and above (lower numbers) are logged for you.

View Code SHELL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Router(config)#logging console ?
  <0-7>          Logging severity level
  alerts         Immediate action needed           (severity=1)
  critical       Critical conditions               (severity=2)
  debugging      Debugging messages                (severity=7)
  emergencies    System is unusable                (severity=0)
  errors         Error conditions                  (severity=3)
  guaranteed     Guarantee console messages
  informational  Informational messages            (severity=6)
  notifications  Normal but significant conditions (severity=5)
  warnings       Warning conditions                (severity=4)
  xml            Enable logging in XML
 
Router(config)#logging console

You can either specify the number or the name of the level. Here I have configured it to show me warning on the console.

View Code SHELL
1
Router(config)#logging console warnings

This does the same as the above command. Router(config)#logging console 4 You can do the same for VTY terminals. Use logging monitor instead of logging console in global configuration mode.

View Code SHELL
1
2
3
4
5
6
7
8
9
10
11
Router(config)#logging monitor ?
  <0-7>          Logging severity level
  alerts         Immediate action needed           (severity=1)
  critical       Critical conditions               (severity=2)
  debugging      Debugging messages                (severity=7)
  emergencies    System is unusable                (severity=0)
  errors         Error conditions                  (severity=3)
  informational  Informational messages            (severity=6)
  notifications  Normal but significant conditions (severity=5)
  warnings       Warning conditions                (severity=4)
  xml            Enable logging in XML

Logging Synchronous

In Synchronous logging, after the message is thrown in to the terminal, router displays the original prompt with what you have already typed. To enable synchronous logging on console ports:

View Code SHELL
1
2
3
4
Router#
Router#conf t
Router(config)#line console 0
Router(config-line)#logging synchronous

To enable logging synchronous on telnet terminals:

View Code SHELL
1
2
3
4
Router#
Router#conf t
Router(config)#line vty 0 4
Router(config-line)#logging synchronous

Now the out put is like this.

View Code SHELL
1
2
3
4
5
Router(config)#
Router#show run
*Mar  1 01:44:37.067: %SYS-5-CONFIG_I: Configured from console
 by console
Router#show run

The router has repeated the prompt with that we have typed. You can get good results be combining the second and third methods wisely. Please see Cisco documentations for more on logging.

Dharshin

Share This:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • blogmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • Netvibes
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz
  • Furl
  • Yigg

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Comment

Note: Comments are moderated in order to mitigate Spam. Therefore your comment will not appear here until I approve it.