Trying to capture a device config and it fails. Why do I receive the following error "SPC-OCC-10746: The operation failed. SPC-NCM-200007: Capture Running Script Returned Error [2]: Can´t locate Net/SSH/Expect.pm in @INC" from a Linux SpectroSERVER when I try to do an NCM capture on a device?
NetOps Spectrum 22.2.x and 23.3.x
Red Hat Linux
The error "Can´t locate Net/SSH/Expect.pm in @INC" means that the PERL module Expect Bundle has not been installed or is installed in a path outside of the PERL @INC path.
As PERL is part of the Linux distribution we do not install PERL modules in Linux during the SpectroSERVER install, and therefore, this needs to be done by the Linux Administrator
To resolve this issue there are two options, an automatic option with connection to the internet for Perl distributions or a manual method incase you do not have internet access on these servers.
Method 1 Automatic Method with Internet Connection
From Root give the following command:
perl -MCPAN -e 'install Bundle::Expect'
The Expect Bundle and all of its dependencies will be installed.
However, if the server has internet access and get an error like next:
Please make sure to install next packages before running the command again:
1. yum install "@Development Tools"
2. yum install perl-CPAN
Method 2 with no internet connection on the Linux server
1. Download https://cpan.metacpan.org/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-1.09.tar.gz from another computer and transfer this to your server
2. gzip -d Net-SSH-Expect-1.09.tar.gz
3. tar xvf Net-SSH-Expect-1.09.tar
4. cd Net-SSH-Expect-1.09
5. perl Makefile.PL
6. make
7. make test
8. make install
9. Execute the following command to verify Net::SSH::Expect is now in the installed perl modules list:
perl -MExtUtils::Installed -e 'print $_,$/ for ExtUtils::Installed->new()->modules();'
10. Print INC paths using the following command:
perl -e "print qq(@INC)"
11. Verify Net::SSH::Expect is in INC path using the following command:
perldoc -l Net::SSH::Expect
Do similar steps to install other modules such as SSH, Tty and Expect:
1. Download https://cpan.metacpan.org/authors/id/I/IV/IVAN/Net-SSH-0.09.tar.gz
2. gzip -d Net-SSH-0.09.tar.gz
3. tar xvf Net-SSH-0.09.tar.gz
4. cd Net-SSH-0.09
5. perl Makefile.PL
6. make
7. make test
8. make install
1. Download https://cpan.metacpan.org/authors/id/T/TO/TODDR/IO-Tty-1.17.tar.gz
2. gzip -d IO-Tty-1.17.tar.gz
3. tar xvf IO-Tty-1.17.tar
4. cd IO-Tty-1.17
5. perl Makefile.PL
6. make
7. make test
8. make install
1. Download https://cpan.metacpan.org/authors/id/J/JA/JACOBY/Expect-1.35.tar.gz
2. gzip -d Expect-1.35.tar.gz
3. tar xvf Expect-1.35.tar
4. cd Expect-1.35
5. perl Makefile.PL
6. make
7. make test
8. make install
Then run instmodsh to list the Perl modules installed:
# instmodsh
Available commands are:
l - List all installed modules
m <module> - Select a module
q - Quit the program
cmd? l
Installed modules are:
Expect
IO::Tty
Net::SSH
Net::SSH::Expect
Perl
Once method 1 or method 2 have been performed you should now be able to capture the configuration from the device with no further errors.