NCM SSH-based Perl Scripts failed with SPC-OCC-10746 error on Linux
search cancel

NCM SSH-based Perl Scripts failed with SPC-OCC-10746 error on Linux

book

Article ID: 6823

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

My custom Network Configuration Manager (NCM) SSH-based Perl Scripts that work on Spectrum which is running on Windows, fail with the following error when Spectrum is migrated to Linux (RHEL) platform.

SPC-OCC-1074: The operation failed. SPC-NCM-20007: Capture Running Script Returned Error [2]: Can't locate Net/SSH/Expect.pm in @INC ... 

       

Although I have confirmed Perl exists in the RHEL platform, I have installed Net::SSH Perl module and I have enabled Use Custom Perl and set up Custom Perl Directory correctly in the Configuration Manager -> Information tab -> Perl Configuration subview.

Environment

SpectroSERVER running on RHEL 7

Cause

Net:SSH:Expect Perl Module hasn't been installed.

Resolution

Login to the SpectroSERVER machine and run 'instmodsh' command and type 'l' to list Perl modules that have been installed and check if you have Net:SSH:Expect module.

If you don't have Net::SSH::Expect module then run 'cpan' utility and on the cpan prompt run 'install Net::SSH::Expect' to install the required Perl Module.




Note that in the above example, the missing module mentioned in the error message is "Expect.pm". There may be different missing modules mentions in different error messages, so be sure to note exactly which module is missing in order to install the right one. For example, you may see an error on "OpenSSH.pm" 

SPC-OCC-1074: The operation failed. SPC-NCM-20007: Capture Running Script Returned Error [2]: Can't locate OpenSSH.pm

In which case, the command to install this module in cpan would be

cpan[1]> install Net::OpenSSH

To make sure all the modules that appears in the above image, you can do next:

1. first install gcc, perl, perl-CPAN and perl-ExtUtils-MakeMaker 

# yum install gcc perl perl-CPAN perl-ExtUtils-MakeMaker

2. run cpan, and then install the cpan module

# cpan
cpan[1]> install CPAN
Reading '/root/.cpan/Metadata'
  Database was generated on Fri, 22 Oct 2021 17:41:03 GMT
CPAN is up to date (2.28).

3. Install Expect from cpan

cpan[2]> install Expect
Reading '/root/.cpan/Metadata'
  Database was generated on Fri, 22 Oct 2021 17:41:03 GMT
Expect is up to date (1.35).

4. Install Net:SSH:Expect from cpan 

cpan[3]> install Net::SSH::Expect
Reading '/root/.cpan/Metadata'
  Database was generated on Fri, 22 Oct 2021 17:41:03 GMT
Net::SSH::Expect is up to date (1.09).

5. Now quit, and run instmodsh

cpan[4]> quit
Terminal does not support GetHistory.
Lockfile removed.

# instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   CPAN
   CPAN::Meta::Requirements
   Expect
   IO::Tty
   Local::Works::Fine
   Net::SSH::Expect
   Perl
   Test::Simple
   version
cmd? q

Additional Information

If the NCM Operations still fail with "cannot locate" messages identify the offending module(s) and locate it on the system and copy it to opt/SPECTRUM/lib/Perl preserving the same directory structure as the location of the original file.

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/22-2/managing-network/network-configuration-manager/network-configuration-manager-configurations/network-configuration-manager-extension-utility.html#concept.dita_365f06e2315d5d81950a2d485914292dc36c4aa3_PerlModules

If the Linux host does not access the internet, follow the steps from this KB article (Method 2):
Error message SPC-OCC-10746: The operation failed. SPC-NCM-200007 when trying to do NCM captures?