Perl error

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.
Locked
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Perl error

Post by MPIvan »

I was trying to use the check_ifoperstatus, but have the folowing error
root@mpnagios:/usr/local/nagios/libexec# ./check_ifoperstatus -h
Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./check_ifoperstatus line 40.
BEGIN failed--compilation aborted at ./check_ifoperstatus line 40.
root@mpnagios:/usr/local/nagios/libexec#
And that line is use Net::SNMP;

Im trying to install Net::SNMP on Ubuntu Server 12.04 with the following command:

Code: Select all

perl -MCPAN -e 'install Net::SNMP'
Also i was trying this

"cpan> install Net::SNMP" and "install Bundle::CPAN"
And have the following errors:
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
DONE
Fetching with HTTP::Tiny:
http://artfiles.org/cpan.org/modules/02 ... ils.txt.gz
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Could not split line["<html>"]
Could not split line["\cI<head>"]
.Could not split line["\cI\cI"]
Could not split line[""]
Giving up parsing your /root/.cpan/sources/modules/02packages.details.txt.gz, too many errors
root@start:/usr/local/nagios/libexec# aptitude -y install snmp
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Perl error

Post by abrist »

Did you try installing net-snmp through apt?

Code: Select all

apt-get install net-snmp
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Perl error

Post by MPIvan »

Nop that not helping too. But after searching through the net i found the solution that works for me, i suppose that this problem is on the New Ubuntu Server 12.04.3 version LTS with the perl default installation. Im not sure about that but thats how i think it is. And here it is the solution ...

1.) mv /root/.cpan /root/.cpanbackup
2.) perl -MCPAN -e shell
3.) cpan > install Bundle::CPAN

and that it is all i hope we can close and sorry that i open this error post but i really need fast help
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Perl error

Post by tmcdonald »

Ahhh perl modules. The bane of setups everywhere :D

And as for opening threads, no need to apologize. That's what we're here for. I will however be closing this thread since the issue has been resolved.
Former Nagios employee
Locked