Page 1 of 2

Can't locate Net/SNMP.pm in @INC

Posted: Wed Sep 12, 2018 10:02 am
by bhaskarbabar
I have again faced same issue.

I want to use ./check_snmp_cisco_bgp.pl to check BGP status on router but while executing this command getting below error again.

Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_snmp_cisco_bgp.pl line 45.
BEGIN failed--compilation aborted at ./check_snmp_cisco_bgp.pl line 45.

dont know whats the issue

Re: Can't locate Net/SNMP.pm in @INC

Posted: Wed Sep 12, 2018 11:55 am
by scottwilkerson
What OS are you running?

You likely need to add the Net::SNMP perl package

for CentOS / RHEL

Code: Select all

yum install 'perl(Net::SNMP)'

Re: Can't locate Net/SNMP.pm in @INC

Posted: Wed Sep 19, 2018 2:16 pm
by bhaskarbabar
Thank you for your reply.

while executing given command gives below error :- sudo yum install 'perl(Net::SNMP)'
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
https://yum.oracle.com/repo/OracleLinux ... repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'yum.oracle.com'"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: public_ol6_UEKR4. Please verify its path and try again


We are using below linux

Oracle Linux Server release 6.10


Also like to add one point here below package is already installed
sudo yum install net-snmp-perl*
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Package 1:net-snmp-perl-5.5-60.0.1.el6.x86_64 already installed and latest version
Nothing to do

Re: Can't locate Net/SNMP.pm in @INC

Posted: Wed Sep 19, 2018 2:41 pm
by scottwilkerson
Is this server behind a proxy?

If so you likely need to configure your proxy setting for yum

https://support.nagios.com/kb/article.php?id=147

Re: Can't locate Net/SNMP.pm in @INC

Posted: Thu Sep 20, 2018 1:14 pm
by bhaskarbabar
Sorry but we dont have proxy server access.

we can download any package needed on PC and Upload via Winscp.

Re: Can't locate Net/SNMP.pm in @INC

Posted: Thu Sep 20, 2018 1:22 pm
by scottwilkerson
The package you need is perl-Net-SNMP from the epel repo

https://fedoraproject.org/wiki/EPEL

Re: Can't locate Net/SNMP.pm in @INC

Posted: Sat Sep 22, 2018 2:21 pm
by bhaskarbabar
Have tried installing epel-release-latest-7.noarch.rpm but still getting error

sudo yum install epel-release-latest-7.noarch.rpm
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Examining epel-release-latest-7.noarch.rpm: epel-release-7-11.noarch
epel-release-latest-7.noarch.rpm: does not update installed package.
Error: Nothing to do

Re: Can't locate Net/SNMP.pm in @INC

Posted: Mon Sep 24, 2018 7:09 am
by scottwilkerson
you need to with this command

Code: Select all

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Re: Can't locate Net/SNMP.pm in @INC

Posted: Tue Sep 25, 2018 10:18 am
by bhaskarbabar
yum install https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm

Given command doesn't work as i dont have proxy access.

sudo yum install https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Cannot open: https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm. Skipping.
Error: Nothing to do

Re: Can't locate Net/SNMP.pm in @INC

Posted: Tue Sep 25, 2018 12:17 pm
by scottwilkerson
If you don't have proxy access and don't have direct access to the internet, installing epel repository will not help then.

You are going to need to find a way to get the required perl-Net-SNMP package and all it's dependencies on the server.