Page 1 of 1

perl available or not?

Posted: Fri Apr 08, 2011 3:14 pm
by sailor
Nagios 3.2.3 on RedHat 5.6

Finally getting around to trying this out after installing it months ago. I'm trying to get a perl script to work. From config.log during during configure:

configure:7812: checking for perl
configure:7830: found /usr/bin/perl
configure:7842: result: /usr/bin/perl
ac_cv_path_PERL=/usr/bin/perl
PERL='/usr/bin/perl'

I can see in nagios.cfg:

enable_embedded_perl=1
use_embedded_perl_implicitly=1

My config:

$USER1$/check_apache.pl -H www.mywebsite.com -p 80 -t 5 -w 200 -c 100

On the console I get just "(null)". I can do a perl check_apache.pl fine outside of Nagios.

Any ideas?

Re: perl available or not?

Posted: Fri Apr 08, 2011 5:11 pm
by tonyyarusso
My guess is that your check requires some feature / library of Perl that is not included in Nagios' embedded Perl interpreter. To check that, try disabling those embedded perl options and restarting Nagios, and see if you get a different result. If you do, then you can get around it by defining which checks should use the embedded perl and which should use the system's perl installation.

Re: perl available or not?

Posted: Tue Apr 12, 2011 7:52 am
by sailor
I found it via only doing this. Other methods seem to work fine.

perl /usr/local/nagios/libexec/check_apache.pl -H mywbsite -po 80 -t 5 -w 200 -c 100

Can't locate utils.pm in @INC (@INC contains: /usr/lib/nagios/plugins /usr/lib64
8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-threa
/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/nag
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_apache.pl l
[root@wsmkmap3t nagios]# perl /usr/local/nagios/libexec/check_apache.pl -H wsmkmwb1p.minoltana.minolta.com -p 80 -t 5 -w 200 -c 100


I came across this https://bugzilla.redhat.com/show_bug.cgi?id=196356

And yet, I have plugins nagios-plugins-1.4.15. I just copied the util in and the error is gone now.

Thanks for the hints.

Re: perl available or not?

Posted: Tue Apr 12, 2011 8:12 am
by sailor
I finally found an error by doing (and only this way (ie ./check_apache.pl works when in the libexec)):

perl /usr/local/nagios/libexec/check_apache.pl -H mywebsite.com -p 80
Can't locate utils.pm in @INC (@INC contains: /usr/lib/nagios/plugins /usr/lib64
8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-threa
/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/nag
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_apache.pl l

I came across this

https://bugzilla.redhat.com/show_bug.cgi?id=196356

and yet I'm have nagios-plugins-1.4.15. After copying utils.pm in, it's working ok now.

Thanks,

Re: perl available or not?

Posted: Tue Apr 12, 2011 9:35 am
by rdedon
Hello sailor,
thank you for the update and sharing that with us :-)

Re: perl available or not?

Posted: Tue Apr 12, 2011 9:36 am
by tonyyarusso
Ah, that would do it. The utils.pm lives in /usr/local/nagios/libexec/, which plugins written only for Nagios installed from RPM/DEB don't expect.