Welcome to Infoblox NetMRI Community Sign in | Join | Help
in Search

Applied Infrastructure

Cisco Debug Enabled?

Have you ever accidentally left debug enabled on a Cisco network device?  I have, many years ago.  I had been doing some troubleshooting and was interrupted by someone with a question.  Auto-logout closed my session and by the time I returned to what I was doing, I'd forgotten where I was.  An hour or so later, an associate asked why remote access was down for a few seconds periodically.  So the debug affected network performance.  We plotted the ping round trip times, which were enlightening.  Can you figure it out from the graph?



The ping packets are buffered by the router during periods when the CPU is busy handling the debug output.  When the debug output is over, the ping packets are immediately processed.  The ramp is dictated by the number of seconds that ping packets were buffered.  The period between buffering events is how often the debug runs.

This type of behavior is more prevalent in software-based routers - the CPU is making the forwarding decisions as well as processing the requested debugging information.  Adding 'no logging console' and 'logging buffered' helps reduce the load because the CPU doesn't have to send debug output to the console port and can buffer the debug output. In the graphic above, the period is 90 seconds, which corresponds to the IGRP update timer (that indicates how long ago it happened).

Back to my original though - how do you know that debug has not been left enabled on some of your network devices?  After we recently found a device with debug enabled, I wrote a quick NetMRI script to do a 'show debug' and create an issue if it is found enabled on any device.  Running this script once a week will let us know if debug is left enabled and allow us to fix it if there's no need for a long-running debug session.  The result will be more efficient network device operation.  The first time I ran the script, it found four devices with debug enabled.

While debug isn't a configuration setting, it is part of the operational configuration of a device and can have a big effect on its performance.  I think of it as part of configuration compliance.  Now I'm satisfied that debug is not accidentally left enabled in the network.

  -Terry


###########################################################################
## Export of Script:  Debug Check
## Script-Level: 3
## Script-Category: Uncategorized
###########################################################################

Script:
    Debug Check

Script-Description:
     Check that debug is not enabled on Cisco devices

###########################################################################
## Export of Script: Debug Check
## Script-Level: 3
## Script-Category: Uncategorized
###########################################################################

Script-Filter:

    $Vendor eq "Cisco"   and
    $sysDescr like /IOS/

#########################################################################
Action:
    Show Debug
Action-Description:
    Execute 'show debug', then check that there was no output.
Action-Commands:
    show debug
Output-Triggers:
    Process Debug

#########################################################################
Trigger: Process Debug
Trigger-Description:
    Match output that contains 'debugging is on'

Trigger-Template:
    debugging is on
Trigger-Commands:
    SET: $found_debug = "yes"
Output-Triggers:
    IssueDebugEnabled

#########################################################################
Issue: IssueDebugEnabled

Issue-ID: DebugEnabled
Issue-Severity:    Warning
Issue-Filter:
    $found_debug eq 'yes'
Issue-Description:
    Debug is enabled on a Cisco device.
Issue-Details:
    Host    $IPAddress
    Name    $Name

#########################################################################
##                            End of Script                            ##
#########################################################################

Comments

No Comments

About tslattery

Terry Slattery, CCIE #1026, is a senior network engineer with decades of experience in the internetworking industry. Prior to joining Chesapeake NetCraftsmen as a full time consultant, Terry was the founder and CTO of Netcordia, and inventor of NetMRI, a suite of network management products. Terry started Netcordia as a consulting company in 2000 and transitioned to a network management product company in 2003. During the consulting days, he used his network design and implementation skills to lead a team in the design and implementation of a high availability network at a brokerage clearing house. Terry is the former President and founder of Chesapeake Computer Consultants, Inc., a networking and computer systems training and consulting company. He co-invented and patented the vLab(tm) internet-based remote lab system. He is co-author of the McGraw Hill text Advanced IP Routing in Cisco Networks. Terry led the team that developed the current Cisco IOS user interface under contract to Cisco Systems. Terry is experienced in the design and installation of large TCP/IP based networks and is a successful network protocol instructor. He is the second Cisco Certified Internetworking Expert (CCIE) #1026 and the first outside of Cisco. He enjoys membership on the Vanderbilt University Engineering School’s Industrial Advisory Board and the IEEE.

This Blog

Syndication