4. Debug Configuration

The debug commands enable detailed debugging information for various protocols.

4.1. Debug Commands in the Classic CLI

The debug commands in the classic CLI are available by entering the debug configuration context.

Debugging configuration is not persistent across CPM switchovers or router reboots.The admin debug-save command saves debugging configuration to config.dbg at the BOF primary-config location if a URL is not specified. The show debug command displays debugging information.

To display debugging output, configure a log using the from debug-trace command and then view the output of the log.

For a description of individual debug commands, refer to the 7450 ESS, 7750 SR, 7950 XRS, and VSR Classic CLI Command Reference Guide.

4.2. Debug Commands in the MD-CLI

A set of debug commands is available natively in the MD-CLI in an exclusive, private, or read-only session via the explicit or implicit configuration mode. The same configuration management commands that are available in the configure region are available in the debug region.

Debugging configuration is not persistent across router reboots.The admin save debug command saves debugging configuration to debug.cfg at the BOF configuration primary-location if a URL is not specified. The admin show configuration debug command displays debugging information and supports all configuration formats, datastores, and output formats that are supported for other regions.

[/]
A:admin@node-2# admin show configuration debug
# Generated THU MAY 06 16:13:08 2021 UTC
debug {
    system {
        management-interface {
            netconf info
        }
    }
}
# Finished THU MAY 06 16:13:08 2021 UTC
 
[/]
A:admin@node-2# admin save debug
Writing configuration to ftp://.../debug.cfg
Saving configuration OK
Completed.

For descriptions of individual debug commands, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR MD-CLI Command Reference Guide.

4.2.1. Logging Debug Events in the MD-CLI

The following MD-CLI commands log debug events to an active CLI session.

— configure
— log
— log-id [id] string
— source
— debug boolean
— destination
— cli
— max-entries number

The following is a sample configuration for debug events that are stored in destination CLI log identifier "7". The log entries wrap at 50 entries (the configured value of max-entries).

(ex)[configure log]
A:admin@node-2# log-id "7"
 
*(ex)[configure log log-id "7"]
A:admin@node-2# source debug
 
*(ex)[configure log log-id "7"]
A:admin@node-2# destination cli max-entries 50
 
*(ex)[configure log log-id "7"]
A:admin@node-2# info
    source {
        debug true
    }
    destination {
        cli {
            max-entries 50
        }
    }

After the commit command is issued to include the log in the running configuration, the following tools command can be executed in the CLI session that is intended to display outputs of the debug events. See the 7450 ESS, 7750 SR, 7950 XRS, and VSR Clear, Show, and Tools Command Reference Guide for more information about the tools command.

[/]
A:admin@node-2# tools perform log subscribe-to log-id "7"

Debug events can be displayed using the show log command and cleared using the clear log command.

[/]
A:admin@node-2# show log log-id "7"
===============================================================================
Event Log 7 log-name 7
===============================================================================
Description : (Not Specified)
Log contents  [size=50   next event=2  (not wrapped)]
 
---snip---
 
[/]
A:admin@node-2# clear log log-id "7"

The following is an example of terminating the output of the logs to the CLI session using the unsubscribe-from command.

[/]
A:admin@node-2# tools perform log unsubscribe-from log-id "7"