DX NetOps

Expand all | Collapse all

Nexus perl capture running config script login error on NCM

Jump to Best Answer
  • 1.  Nexus perl capture running config script login error on NCM

    Posted 08-03-2017 09:52 AM
      |   view attached

    Spectrum NCM Perl capture running script failing with login error but works fine when run from bash shell on same Spectroserver. 

     

    I followed a tech article to make a copy of script and run it directly from bash shell and it captures the config just fine.  But trying it from the capture button on host configuration tab the error is produced right away.

     

    I have some Nexus devices where we are getting the following error message every time we hit the capture config button which runs the perl script.  I haven't found anything in the config on the device but do not exactly understand the error message.  Has anyone had success in resolving this?  Attaching screenshot.

     

    Error message:

    ==================

    SPC-OCC-10746:  The operation failed.  SPC-NCM-20007: Capture Running Script Returned Error [252]:Login Error:

    Use of uninitialized value in concatenation (.) or string at C:/Windows\Temp\script_5 line 110.

    ================

     

    Line 110 is the statement in red.

    my $login_output;
          eval { $login_output = $ssh->login(); };
          if( $@ )
          {
              $msg = "Login has failed. Output: $login_output";                  <--- This is line 110 in perl script
              return( 252, $msg );
          }



  • 2.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-03-2017 03:51 PM


  • 3.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-03-2017 09:27 PM

    I agree with okasi01 that TEC185895 may resolve the problem. The SSH key data is stored under .ssh directory in each user's home. It was successful when the script is run manually by different OS user but not the 'spectrum' user.



  • 4.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-07-2017 11:45 AM

    I tried that but it did not work.  Interestingly there was only one entry in the known_hosts file of an affected device.  I have a few other Nexus switches with same exact error with no entry in the known_hosts file.  The script runs fine from a cmd line in Spectroserver and I can ssh to the switch fine from OneClick console and from a Putty client on the OneClick console  I will try to erase the SSH key on the device itself, create, a new one then try the OneClick capture again.  Strange indeed.



  • 5.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-07-2017 11:51 AM

    I meant to say I can SSH just fine from a Putty client on the Spectroserver instead of OneClick.



  • 6.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-09-2017 03:02 AM

    What OS user you are using? Is that the Spectrum Install Owner user?



  • 7.  Re: Nexus perl capture running config script login error on NCM

    Posted 08-09-2017 03:30 AM

    The error you have there clearly states that $login_output is uninitialized. Thus, that means the ssh_login function didn't work as expected and didn't return anything. Are you sure of the variables declaration in Spectrum? Are you sure of the declaration of the user, password and enable password?



  • 8.  Re: Nexus perl capture running config script login error on NCM
    Best Answer

    Posted 08-23-2017 04:34 PM

    Colleague found known_host file also located at this path also.  There is one in the Install user account as tech article states but there was another.  Renamed to .old then new file created and we could pull configs from Nexus device that were previously not working.

    Other Path:  Specroot\NT-Tools\SRE\.ssh
    Should the tech article be updated?