![]() |
|||||||
Debugging a Switch Router
![]() |
|||||||
Table of ContentsDebugging a Switch RouterUsing the Debug Interface Entering debug Commands
Enabling Message LoggingUsing the debug ? Command Using the debug all Command: Warning Generating debug Command Output Redirecting Debugging and Error Message Output Setting the Message Logging Levels
Limiting the Types of Logging Messages Sent to the Console Logging Messages to an Internal Buffer Limiting the Types of Logging Messages Sent to Another Monitor Logging Messages to a UNIX Syslog Server Limiting Messages to a Syslog Server Displaying the Logging Configuration Debugging a Switch RouterThis appendix provides an overview of the debug commands that might be helpful when troubleshooting your switch router. This appendix consists of the following sections: Use debug commands to isolate problems, not to monitor normal network operation. Because the high overhead of debug commands can disrupt switch router operation, use debug commands only when you are looking for specific types of traffic or problems and have narrowed your problems to a likely subset of causes. Output formats vary with each debug command. Some generate a single line of output per packet, and others generate multiple lines of output per packet. Some generate large amounts of output, and others generate only occasional output. Some generate lines of text, and others generate information in field format. Follow these steps to minimize the negative impact of using debug commands: Step 1 Use the no logging console global configuration command on your switch router. This command disables all logging to the console terminal. Step 2 Use Telnet to connect to a switch router port, and enter the enable EXEC command. Step 3 Use the terminal monitor command to copy debug command output and system error messages to your current terminal display. As a result, you can view debug command output remotely, without being connected through the console port. Because the console port no longer has to generate character-by-character processor interrupts, following this procedure minimizes the load created by using debug commands. If you intend to keep the output of the debug command, spool the output to a file. The procedure for setting up such a debug output file is described in the Cisco IOS Debug Command Reference publication. This publication provides complete details regarding the function and output of debug commands, and includes specific debug commands that are useful when troubleshooting specific problems. Using the Debug InterfaceThis section explains how to diagnose and resolve internetworking problems by using debug commands, and covers the following topics: Entering debug CommandsAll debug commands are entered in privileged EXEC mode, and most debug commands take no arguments. For example, to enable the debug atm packet command, enter the following in privileged EXEC mode at the command line: To display the status of each debugging option, enter the show debugging command in privileged EXEC mode: To turn off the debug atm packet command in privileged EXEC mode, enter the no form of the command at the command line: Using the debug ? CommandTo list and see a brief description of all the debug command options, at the command line enter the debug ? command in privileged EXEC mode, as shown in the following example:
Using the debug all Command: WarningTo enable all system diagnostics, you can enter the debug all command in privileged EXEC mode at the command line. The no debug all command turns off all diagnostic output. Using this command is a convenient way to ensure that you have not accidentally left any debug commands turned on. Generating debug Command OutputEnabling a debug command can result in output similar to the following example for the debug lane client all command: The switch router continues to generate such output until you enter the corresponding no debug command (in this case, no debug lane client all). If you enable a debug command and no output is displayed, consider the following possibilities:
Redirecting Debugging and Error Message OutputBy default, the network server sends the output from debug commands and system error messages to the console terminal. If you use this default, monitor debugging output with a virtual terminal connection, rather than the console port. To redirect debugging output, use the variations of the logging command within configuration mode as described in the following sections. Possible destinations include the console terminal, virtual terminals, internal buffer, and UNIX hosts running a syslog server. The syslog format is compatible with 4.3 Berkeley Standard Distribution (BSD) UNIX and its derivatives.
To configure message logging, you need to be in configuration command mode. To enter this mode, use the configure terminal command at the EXEC prompt. Enabling Message LoggingBy logging messages you can redirect debug output to a file, memory, or a remote host connection. This section contains the following:
To configure message logging, use any of the following global configuration commands. Use the no form of the command to assign the default value:
ExamplesTo enable message logging to all supported destinations other than the console, enter the logging on command as in the following example: To direct logging to the console terminal only and disable logging output to other destinations, enter the no logging on command as in the following example: Setting the Message Logging LevelsYou can set the logging levels when you log messages to the following devices: Table A-1 lists and briefly describes the logging levels and corresponding keywords you can use to set the logging levels for these types of messages. The highest level of message is 0, emergencies. The lowest level is 7, debugging, which also displays the largest number of messages. For information about limiting these messages, refer to the sections that follow. Limiting the Types of Logging Messages Sent to the ConsoleThe logging console command limits the logging messages displayed on the console terminal to messages up to and including the specified severity level, which is specified by the level argument. The level argument is one of the keywords listed in Table A-1. Keywords are listed in order from the most severe level to the least severe level. The no logging console command disables logging to the console terminal. ExampleThe following example sets console logging of messages at the debugging level, which is the least severe level and displays all logging messages: Logging Messages to an Internal BufferThe logging buffered command copies logging messages to an internal buffer instead of writing them to the console terminal. The buffer is circular in nature, so newer messages overwrite older messages. To display the messages that are logged in the buffer, use the show logging privileged EXEC command. The first message displayed is the oldest message in the buffer. The no logging buffered command cancels the use of the buffer and writes messages to the console terminal, which is the default setting. ExampleThe following example copies logging messages to buffered memory and sets the memory buffer space as 10,000 bytes: Limiting the Types of Logging Messages Sent to Another MonitorThe logging monitor command limits the logging messages that are displayed on terminal linesother than the console lineto messages with a level up to and including the specified level argument. The level argument is one of the keywords listed in Table A-1. To display logging messages on a terminal (virtual console), use the terminal monitor privileged EXEC command. The no logging monitor command disables logging to terminal lines other than the console line. ExampleThe following example sets the level of messages displayed on monitors other than the console to notification level: Logging Messages to a UNIX Syslog ServerThe logging command identifies a syslog server host to receive logging messages. The ip-address argument is the IP address of the host. By issuing this command more than once, you build a list of syslog servers that receive logging messages. The no logging command deletes the syslog server with the specified address from the list of syslogs. ExampleThe following example configures syslog server host diablo.cisco.com to receive the logging messages: Example of Setting Up a UNIX Syslog DaemonTo set up the syslog daemon on a 4.3 BSD UNIX system, include a line such as the following in the file /etc/syslog.conf: The local7 keyword specifies the logging facility to be used. The debugging keyword specifies the syslog level. See Table A-1 for other keywords that can be listed. The UNIX system sends messages at or above this level to the specified file, in this case /usr/adm/logs/tiplog. The file must already exist, and the syslog daemon must have permission to write to the specific file. For System V UNIX systems, the line should read as follows: Limiting Messages to a Syslog ServerThe logging trap command limits the logging messages sent to syslog servers to messages with a level up to and including the specified level argument. The level argument is one of the keywords listed in Table A-1. To send logging messages to a syslog server, specify its host address with the logging command. The default trap level is the informational level. The no logging trap command disables logging to syslog servers. ExampleThe following example configures traps sent to the syslog server as informational: Displaying the Logging ConfigurationTo display the logging configuration, use the following command in user EXEC mode: ExampleThe following example shows the addresses and levels associated with the current logging setup. The command output also includes ancillary statistics.
|
|||||||
|
|