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.
Net:SSH:Expect Perl Module hasn't been installed.
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.
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]> quitIf 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.
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?