Page 1 of 1

Can't locate Nagios/Plugin.pm in @INC

Posted: Sun Dec 16, 2012 3:48 am
by zaji_nms
[root@localhost libexec]# ./check_cisco_fru_module.pl -h
Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at ./check_cisco_fru_module.pl line 30.
BEGIN failed--compilation aborted at ./check_cisco_fru_module.pl line 30.

in line 30 as below
26 use strict;
27
28 use lib "/usr/local/nagios/libexec";
29
30 use Nagios::Plugin;
31 use Net::SNMP;

Re: Can't locate Nagios/Plugin.pm in @INC

Posted: Sun Dec 16, 2012 3:50 am
by zaji_nms
[root@localhost libexec]# ./check_cisco_fru_ps.pl -V
Bareword "UNKNOWN" not allowed while "strict subs" in use at ./check_cisco_fru_ps.pl line 299.
Bareword "OK" not allowed while "strict subs" in use at ./check_cisco_fru_ps.pl line 312.
Bareword "UNKNOWN" not allowed while "strict subs" in use at ./check_cisco_fru_ps.pl line 316.
Bareword "UNKNOWN" not allowed while "strict subs" in use at ./check_cisco_fru_ps.pl line 134.
Bareword "UNKNOWN" not allowed while "strict subs" in use at ./check_cisco_fru_ps.pl line 140.
Execution of ./check_cisco_fru_ps.pl aborted due to compilation errors.

Re: Can't locate Nagios/Plugin.pm in @INC

Posted: Mon Dec 17, 2012 10:17 am
by scottwilkerson
zaji_nms wrote:Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at ./check_cisco_fru_module.pl line 30.
You should be able to run the following to install the missing package

Code: Select all

yum install perl-Nagios-Plugin -y

Re: Can't locate Nagios/Plugin.pm in @INC

Posted: Mon Dec 17, 2012 11:23 am
by CGraham
zaji_nms,

In general when you get an alert like this in perl:

Code: Select all

Can't locate Something/Other.pm
you can run this:

Code: Select all

yum install perl-Something-Other -y
and it will install the pre-requisite.