Menu

iosscraper script after running TDR cable diagnostics causes interface not to update

Help
Darren
2014-09-16
2014-10-13
  • Darren

    Darren - 2014-09-16

    Hi,

    NetDB is a great script, we use it every day and it has helped so much.

    We have noticed an odd issue with the iosscraper.pl script when it gathers the Interface status on a Cisco Catalyst 3750 switch.

    The scraper script itself works fine under normal circumstances. The issue only appears after we have run a cable test on a switch interface using the “test cable-diagnostics tdr interface” command on the switch.

    Once we have run this command on the switch the text of the status gets changed slightly, for example…

    Normal interface status output:

    Gi5/0/18 connected 501 a-full a-100 10/100/1000BaseTX

    Interface status output after running a cable test on the interface:

    Gi5/0/18 connected: T 501 a-full a-100 10/100/1000BaseTX

    Note – there is an extra colon and a letter T after the word connected.

    The effect of this is that the line get skipped when iosscraper,pl is gathering interface data and it doesn’t parse the line correctly. Furthermore, the status of that interface will never be updated as long as this is the case.

    I’ve traced the cause of this to line 663 of iosscaper.pl (v1.12) which causes the line to be skipped and perhaps some of the logic in lines 667 and 668. I have tried adding the status “connected:” to the list of valid statuses, although this causes the line to be processed - but changes the order of the resulting data.

    # If line contains int status
                if ( $line =~ /\s(connected|disabled|notconnect?|faulty|monitor(ing)?|up|down|sfpAbsent|err\-disabled)\s/ ) {
                    $state = $1;
    

    I’ve tried

    # If line contains int status
    
                if ( $line =~ /\s(connected|connected:|disabled|notconnect?|faulty|monitor(ing)?|up|down|sfpAbsent|err\-disabled)\s/ ) {
                    $state = $1;
    

    I just wanted to report this one and ask if anyone has any ideas how it might be overcome or report it as a bug.

    Darren.

     

    Last edit: Darren 2014-09-16
    • Jonathan Yantis

      Jonathan Yantis - 2014-09-16

      Darren,

      I’m glad things are mostly working for you. I tried some cable-diagnostics on a couple of my 3750s and didn’t see this behavior. What version is on your switches? That definitely seems like an IOS glitch. If it’s widespread, I could patch for it of course.

      Try adding this line above the if statement as there seems to also be a stray T in the output.

      $line =~ s/connected:\sT/connected/;

      Hopefully that will fix the glitch for now.

      Jonathan

      On Sep 16, 2014, at 6:41 AM, Darren dswarwick@users.sf.net wrote:

      Hi,

      NetDB is a great script, we use it every day and it has helped so much.

      We have noticed an odd issue with the iosscraper.pl script when it gathers the Interface status on a Cisco Catalyst 3750 switch.

      The scraper script itself works fine under normal circumstances. The issue only appears after we have run a cable test on a switch interface using the “test cable-diagnostics tdr interface” command on the switch.

      Once we have run this command on the switch the text of the status gets changed slightly, for example…

      Normal interface status output:

      Gi5/0/18 connected 501 a-full a-100 10/100/1000BaseTX

      Interface status output after running a cable test on the interface:

      Gi5/0/18 connected: T 501 a-full a-100 10/100/1000BaseTX

      Note – there is an extra colon after the word connected.

      The effect of this is that the line get skipped when iosscraper,pl is gathering interface data and it doesn’t parse the line correctly. Furthermore, the status of that interface will never be updated as long as this is the case.

      I’ve traced the cause of this to line 663 of iosscaper.pl (v1.12) which causes the line to be skipped and perhaps some of the logic in lines 667 and 668. I have tried adding the status “connected:” to the list of valid statuses, although this causes the line to be processed it changes the order of the data.

      If line contains int status

              if ( $line =~ /\s(connected|disabled|notconnect?|faulty|monitor(ing)?|up|down|sfpAbsent|err\-disabled)\s/ ) {
                  $state = $1;
      

      I’ve tried

      If line contains int status

              if ( $line =~ /\s(connected|connected:|disabled|notconnect?|faulty|monitor(ing)?|up|down|sfpAbsent|err\-disabled)\s/ ) {
                  $state = $1;
      

      I just wanted to report this one and ask if anyone has any ideas how it might be overcome or report it as a bug.

      Darren.

      iosscraper script after running TDR cable diagnostics causes interface not to update

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/netdbtracking/discussion/939989/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
      • Darren

        Darren - 2014-09-23

        We are currently running IOS 15.0(2)SE.

        When we run a TDR cable test, IOS appends a piece of text to the status to tell you that the test is running, but that piece of text is never removed, even after the test is complete. As you say, it's probably a cosmetic bug in the IOS code.

        There is a command 'clear cable-diagnostics tdr interface' which I understand stops the test and clears the interface back to normal, but that command isn't available on our version of IOS.

        Anyway, the fix you posted appears to have done the trick and our database is now being updated for any interfaces that have had the test run on them.

        Thankyou for your quick response.

         
        • Jonathan Yantis

          Jonathan Yantis - 2014-09-23

          Darren,

          Thanks for the feedback, I’ll just go ahead and include that in the code as a workaround which should handle all cases.

          Jonathan

          On Sep 23, 2014, at 7:52 AM, Darren dswarwick@users.sf.net wrote:

          We are currently running IOS 15.0(2)SE.

          When we run a TDR cable test, IOS appends a piece of text to the status to tell you that the test is running, but that piece of text is never removed, even after the test is complete. As you say, it's probably a cosmetic bug in the IOS code.

          There is a command 'clear cable-diagnostics tdr interface' which I understand stops the test and clears the interface back to normal, but that command isn't available on our version of IOS.

          Anyway, the fix you posted appears to have done the trick and our database is now being updated for any interfaces that have had the test run on them.

          Thankyou for your quick response.

          iosscraper script after running TDR cable diagnostics causes interface not to update

          Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/netdbtracking/discussion/939989/

          To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

           
  • Darren

    Darren - 2014-10-13

    Following up on this, it seems the issue we're experiencing is due to a bug in the Cisco code.

    https://tools.cisco.com/bugsearch/bug/CSCud03270

    The bug affects the code that we're running but it is fixed in SE2.

    For those that might be experiencing this problem, it is also possible to clear the erroneous status by using SNMP.

    ===========

    Symptom:
    "TDR running" displayed in "show int" after executing test TDR cmd
    Conditions:
    2960S, 15.0(2)SE
    Workaround:
    Use SNMP set to stop the TDR by ccdTdrIfAction 2 (clear) in CISCO-CABLE-DIAG-MIB

    ===========

     

Log in to post a comment.