Embedded Perl Does not find installed Perl Modules

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
sford_asurion
Posts: 4
Joined: Tue Jun 28, 2011 6:38 pm

Embedded Perl Does not find installed Perl Modules

Post by sford_asurion »

All,

I have a custom check_snmp.pl script that runs fine via the command line, but in Nagios it is returning the dreaded "Service check did not exit properly" line. The script calls Net::SNMP queries various OIDs on the target host. I use the embedded perl interpreter with Nagios...it has always worked great for me...unless it doesn't. :) I turned debugging on for the embedded perl. The debug log is saying that it cannot locate Net::SNMP in @INC, but the module is there in my include path.

Wed Mar 14 17:36:59 2012 eval_file: syntax error in /usr/local/nagios/libexec/check_snmp.pl: "Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 2) line 9,
BEGIN failed--compilation aborted at (eval 2) line 16.".

[root@server Net]# pwd
/usr/lib/perl5/site_perl/5.8.8/Net
[root@venda Net]# ls
SNMP SNMP.pm

I have the latest version of Net::SNMP installed on this server...

[root@server ]# yum install net-snmp-perl.x86_64
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Package 1:net-snmp-perl-5.3.2.2-14.el5_7.1.x86_64 already installed and latest version

Does anyone have any experience with this? Any support is greatly appreciated.

Thanks,

Scott
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Embedded Perl Does not find installed Perl Modules

Post by yancy »

Maybe your missing perl-Config-IniFiles

if your using fedora/redhat:

yum install perl-Config-IniFiles
sford_asurion
Posts: 4
Joined: Tue Jun 28, 2011 6:38 pm

Re: Embedded Perl Does not find installed Perl Modules

Post by sford_asurion »

Thanks for your reply...

I am using Red Hat Enterprise Linux Server release 5.7 (Tikanga). While perl-Config-IniFiles was not installed, It is not installed on any other Nagios host that I use, and I do not have any problems. That being said, I did install it, but the problem persists.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Embedded Perl Does not find installed Perl Modules

Post by scottwilkerson »

The package it is arguing about is perl-Net-SNMP not net-snmp-perl

Code: Select all

yum install perl-Net-SNMP -y
Confusing, but they aren't the same
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked