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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

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

Post 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;
Zajil NMS
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

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

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

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
CGraham
Posts: 115
Joined: Tue Aug 16, 2011 2:43 pm

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

Post 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.
Locked