6. Troubleshooting

6.1. Debug commands

The debug command is not natively supported in the MD-CLI. The command can be executed from the classic CLI. The // command can be used to switch to the classic CLI engine from the MD-CLI engine. Both debug and /debug are supported in the classic CLI.

[]
A:admin@node-2# //
INFO: CLI #2051: Switching to the classic CLI engine
A:node-2# debug router bgp packets
A:node-2#
A:node-2# /debug router bgp packets
A:node-2#

6.2. Logging Debug Events in the MD-CLI

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

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

The following example shows the configuration for debug events to be 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 has been issued to include the log in the running configuration, the following tools command can be executed in the CLI session that will be used to display outputs of the debug events. Refer to the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide for more information about the tools command.

(ex)[tools perform log]
A:admin@node-2# subscribe-to log-id 7
 
(ex)[]
A:admin@node-2#

The 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
===============================================================================
Description : (Not Specified)
Log contents  [size=50   next event=2  (not wrapped)]
 
---snip---
 
[]
A:admin@node-2# clear log log-id 7
 
[]
A:admin@node-2#

To terminate the output of the logs to the CLI session, use the unsubscribe-from command as shown.

(ex)[]
A:admin@node-2# tools perform log unsubscribe-from log-id 7
 
(ex)[]
A:admin@node-2#