|
This chapter explains how you use debug commands to diagnose and resolve internetworking problems. Specifically, it covers the following topics:
Caution Because debugging output is assigned high priority in the CPU process, it can render the system unusable. For this reason, only use debug commands to troubleshoot specific problems or during troubleshooting sessions with Cisco technical support staff. Moreover, it is best to use debug commands during periods of lower network traffic and fewer users. Debugging during these periods decreases the likelihood that increased debug command processing overhead will affect system use. |
All debug commands are entered while in privileged EXEC mode and most debug commands do not take any arguments. For example, to enable the debug broadcast command, enter the following in privileged EXEC mode at the command line:
debug broadcastTo turn off the debug broadcast command, in privileged EXEC mode, enter the no form of the command at the command line:
no debug broadcastAlternately, in privileged EXEC mode, you can enter the undebug form of the command:
undebug broadcastTo display the state of each debugging option, enter the following at the command line in privileged EXEC mode:
show debuggingTo list and briefly describe all of the debugging command options, enter the following command in privileged EXEC mode at the command line:
debug ?To enable all system diagnostics, enter the following command in privileged EXEC mode at the command line:
debug allThe no debug all command turns off all diagnostic output. Using the no debug all command is a convenient way to ensure that you have not accidentally left any debug commands turned on.
Enabling a debug command can result in output similar to the example shown in Figure 1-1 for the debug broadcast command.
router# debug broadcast
Ethernet0: Broadcast ARPA, src 0000.0c00.6fa4, dst ffff.ffff.ffff,
type 0x0800, data 4500002800000000FF11EA7B, len 60
Serial3: Broadcast HDLC, size 64, type 0x800, flags 0x8F00
Serial2: Broadcast PPP, size 128
Serial7: Broadcast FRAME-RELAY, size 174, type 0x800, DLCI 7a
The router continues to generate such output until you enter the corresponding no debug command (in this case, no debug broadcast).
If you enable a debug command and no output is displayed, consider the following possibilities:
By 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 using a virtual terminal connection, rather than the console port.
To redirect debugging output, use the logging command options within configuration mode.
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 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.
The following sections describe how to select redirection options with the logging router configuration command.
To enable message logging to all supported destinations other than the console, enter the following:
logging onThe default condition is logging on.
no logging onYou can set the logging levels when logging messages to the following:
Table 1-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 level 0, emergencies. The lowest level is level 7, debugging, which also displays the greatest amount of messages. For information about limiting these messages, see sections later in this chapter.
To limit the types of messages that are logged to the console, use the logging console router configuration command. The full syntax of this command follows:
logging console levelThe 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 can be one of the keywords listed in Table 1-1. They are listed in order from the most severe level to the least severe.
The no logging console command disables logging to the console terminal.
The following example sets console logging of messages at the debugging level, which is the least severe level and will display all logging messages:
logging console debugging
The default logging device is the console; all messages are displayed on the console unless otherwise specified.
To log messages to an internal buffer, use the logging buffered router configuration command. The full syntax of this command follows:
logging bufferedThe 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 privileged EXEC command show logging. 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 (the default).
To limit the level of messages logged to the terminal lines (monitors), use the logging monitor router configuration command. The full syntax of this command follows:
logging monitor levelThe logging monitor command limits the logging messages displayed on terminal lines other than the console line to messages with a level up to and including the specified level argument. The level argument is one of the keywords listed in Table 1-1. To display logging messages on a terminal (virtual console), use the privileged EXEC command terminal monitor.
The no logging monitor command disables logging to terminal lines other than the console line.
The following example sets the level of messages displayed on monitors other than the console to notification:
logging monitor notification
To log messages to the syslog server host, use the logging router configuration command. The full syntax of this command follows:
logging ip-addressThe no logging command deletes the syslog server with the specified address from the list of syslogs.
To limit how many messages are sent to the syslog servers, use the logging trap router configuration command. The full syntax of this command follows:
logging trap levelThe 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 1-1.
To send logging messages to a syslog server, specify its host address with the logging command.
The default trap level is informational.
The no logging trap command disables logging to syslog servers.
The current software generates four categories of syslog messages:
The privileged EXEC command show logging displays the addresses and levels associated with the current logging setup. The command output also includes ancillary statistics.
To 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:
local7.debugging /usr/adm/logs/tiplog
The local7 keyword specifies the logging facility to be used.
The debugging keyword specifies the syslog level. See Table 1-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 it.
Posted: Mon Oct 21 11:23:40 PDT 2002
All contents are Copyright © 1992--2002 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.