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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
bhaskarbabar
Posts: 19
Joined: Tue Jun 05, 2018 6:48 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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)'
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bhaskarbabar
Posts: 19
Joined: Tue Jun 05, 2018 6:48 am

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

Post 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
Last edited by bhaskarbabar on Wed Sep 19, 2018 4:16 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bhaskarbabar
Posts: 19
Joined: Tue Jun 05, 2018 6:48 am

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

Post by bhaskarbabar »

Sorry but we dont have proxy server access.

we can download any package needed on PC and Upload via Winscp.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

The package you need is perl-Net-SNMP from the epel repo

https://fedoraproject.org/wiki/EPEL
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bhaskarbabar
Posts: 19
Joined: Tue Jun 05, 2018 6:48 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bhaskarbabar
Posts: 19
Joined: Tue Jun 05, 2018 6:48 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked