Nagios Can't locate utils.pm in @INC

by GarciaPL on Wednesday 11 July 2012

Nagios


I am currently working on a plugin for Nagios and i was faced with small problem :(


Can't locate utils.pm in @INC (@INC contains: /usr/local/nagios/libexec /opt/nagios/perl/lib /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at ./HSRPCheck.pl line 22.



The main reason due to this error is a wrong defined library in Perl script (or whatever other language) for check_snmp_int module. So, the solution of this problem is quite easy. You should just change in your script this line :


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

to

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


and whala! Now it works ;)

PS. Also your Nagios can be installed in other directory, so just execute this one command in terminal :

locate /nagios/plugins

and if you get full path to directory which contains plugins just paste it to your script. (use lib 'Received Path')

Of course i will post my script related with this issue in the separate post ;-)



Nagios | The Industry Standard in IT Infrastructure Monitoring




Reference :