DX NetOps

 View Only
  • 1.  NCM Error: Login has failed. Didn't see device prompt as expected.

    Posted Jun 23, 2017 08:57 AM

    Hello All

     

    While running NCM backup on a device, I am getting following error.

     

    SPC-NCM-20007: Capture Running Script Returned Error [252]: Login Error:
    Host 10.19.180.214:
    Login has failed. Didn't see device prompt as expected. 

     

     

    What might be the cause of getting such error and how to overcome it? Kindly help.

     

     

    Thanks in advance

    Soumyadipta



  • 2.  Re: NCM Error: Login has failed. Didn't see device prompt as expected.

    Broadcom Employee
    Posted Jun 25, 2017 10:47 PM

    Hi Soumyadipta,

     

    There may be several different reasons behind this error. However i would first have a look at the below Tech Doc and see if this helps.

     

    Error SPC-NCM-20007 is received when doing a device configuration capture in NCM 

     

    Regards,

    Tarun



  • 3.  Re: NCM Error: Login has failed. Didn't see device prompt as expected.
    Best Answer

    Broadcom Employee
    Posted Jun 27, 2017 01:37 AM

    I assume you are using Perl script. So the script failed within the following code section.

      # login output should contain the right prompt characters
      if( $login_output !~ /\#\s*\z/ )
      {
        $msg = "Login has failed. Didn't see device prompt as expected.";
        $ssh->close();
        return( 252, $msg );
      }

    The code section is validating the output after SSH into the device. It uses Regex '/\#\s*\z/' which is basically looking '#' character in the output, i.e. the prompt.

    As the prompt ('#') doesn't exist it throws out "Login has failed. Didn't see device prompt as expected." error message.

    You can test by launch bash login shell on the SpectroSERVER machine and run the following command to SSH into the device.

         ssh <user>@<device hostname>

    And verify if you are getting the correct prompt as what the Perl script has expected. If no then you have to fix this SSH issue or you may want to change the Perl codes.



  • 4.  Re: NCM Error: Login has failed. Didn't see device prompt as expected.

    Posted Jul 20, 2017 04:26 AM

    Hi Widjaja

     

    Thanks for your help. Following the part in my script like above mentioned. Would you please help me on the change I need to make in this part of the script so that it stop throwing errors?

     

    # if( $login_output !~ /\#\s*\z/ )
    if ( $login_output !~ /\#/i )
    {
    $msg = "Login has failed. Didn't see device prompt as expected.";
    $ssh->close();
    return( 252, $msg );
    }

     

    Thanks

    Soumyadipta Ganguly



  • 5.  Re: NCM Error: Login has failed. Didn't see device prompt as expected.

    Posted Jul 20, 2017 05:44 AM

    Hi,

     

    in order to get the CA  Cisco NX OS script working I've done the following changes

    ...

          # if( $login_output !~ /\#\s*\z/ )
          if( $login_output !~ /#/ )   
          {
              $msg = "Login has failed. Didn't see device prompt as expected.";
              $ssh->close();
              #return( 252, $msg );
              return( 252, $login_output );
          }

     

    ...

     
      # because the configuration contains also a % sign, do not exit
      #    if( scalar grep { $_ =~ /^%/ } @config )
      #   {
      #        # Ensure show running actually returned the config and not an error
      #        # message containing '%'
      #        return( 245, @config );
      #    }

     

    Regards,

    Olaf