Page 1 of 1

compiling nagios-plugins error with perl

PostPosted: Tue Aug 23, 2022 6:26 am
by SandrilaFriman
I'm trying to compile the nagios plugins in a RHEL8 box but it fails and reports an error message when running tools/build_perl_modules

make[2]: Entering directory '/root/nagios-plugins-2.2.1/perlmods'
../tools/build_perl_modules -d /usr/local/nagios/perl -em .
make[2]: ../tools/build_perl_modules: Command not found
make[2]: *** [Makefile:1462: all-local] Error 127
make[2]: Leaving directory '/root/nagios-plugins-2.2.1/perlmods'
make[1]: *** [Makefile:1431: all-recursive] Error 1
make[1]: Leaving directory '/root/nagios-plugins-2.2.1'
make: *** [Makefile:1352: all] Error
I compiled these same nagios plugins in RHEL5, RHEL6 and RHEL7 some time ago with no problem.

The tools/build_perl_modules does EXIST:

# ls -l tools/build_perl_modules
-rwxr-xr-x 1 root root 9999 Jun 16 12:27 tools/build_perl_modules
In fact, when launched that perl program:

# ../tools/build_perl_modules -d /usr/local/nagios/perl -em .
-bash: ../tools/build_perl_modules: yes: bad interpreter: No such file or directory
This message is because of the shebang line

which is very weird for me. And yet, it worked in previous echatspin echatrandom RHEL releases!

Re: compiling nagios-plugins error with perl

PostPosted: Mon Aug 29, 2022 7:27 am
by SandraLewisFrin
I've been banging my head off NRPE and Perl for weeks now.

I decided to start from absolute first principles, and create a dummy nagios plugin that does nothing but always returns OK. I called it, installed it on the remote server and configured NRPE to serve it out as check_test.

The entire script is just:


print "OK - this dummy test always returns OK\n";
exit 0;
This works over NRPE without problems.

With this as a starting point, I was going to build up the script I want slowly to see at what point it breaks. I didn't get at all far. The follow breaks over NRPE (but works fine with locally and over SSH):


use strict;

print "OK - this dummy test always returns OK\n";
exit 0;
It gives the dreaded error: NRPE: Unable to read output.

I can't include ANYTHING or I get this error. This makes it impossible to do what I actually need to do!

I thought it might be a problem with the perl include path, but running the following over NRPE shows it is not (gives identical include path as when run on the terminal):


print "OK - Perl include path: ".join(q{, }, @INC)."\n";
exit 0;
Does anyone know why NRPE is behaving so badly omegle shagle voojio with Perl? Can anyone recommend a fix? Or even a workaround?