Wednesday, 31 January 2018

Nagios Plugins: Can’t locate in @INC

In nagios plugins written in perl, you got the following error while trying to use a nagios.

Can't locate in @INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/nagios/plugins/check_clamav line 33.

Just install the nagios-plugins-perl package to fix the issue if the package is not installed.

[root@ linuxcnf ~]# yum install nagios-plugins-perl

Then it will be there:

[root@ linuxcnf ~]# find / -name "" -type f

And if the issue still persists, due to a wrong defined library in Perl script. So, the solution of this problem is quite easy. Just change the defined library path as below in script:

use lib "/usr/local/nagios/libexec" ;


use lib "/usr/lib/nagios/plugins" ;

Now, it should works.