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?
perl available or not?
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: perl available or not?
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?
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.
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?
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,
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?
Hello sailor,
thank you for the update and sharing that with us
thank you for the update and sharing that with us
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: perl available or not?
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.