Page 1 of 1

Embedded Perl Does not find installed Perl Modules

Posted: Thu Mar 15, 2012 12:09 pm
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

Re: Embedded Perl Does not find installed Perl Modules

Posted: Thu Mar 15, 2012 3:33 pm
by yancy
Maybe your missing perl-Config-IniFiles

if your using fedora/redhat:

yum install perl-Config-IniFiles

Re: Embedded Perl Does not find installed Perl Modules

Posted: Thu Mar 15, 2012 4:24 pm
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.

Re: Embedded Perl Does not find installed Perl Modules

Posted: Thu Mar 15, 2012 4:31 pm
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