compiling nagios-plugins error with perl

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
SandrilaFriman
Posts: 9
Joined: Fri Jun 17, 2022 4:48 am

compiling nagios-plugins error with perl

Post 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

#!yes
# SYNTAX:
which is very weird for me. And yet, it worked in previous echatspin echatrandom RHEL releases!
Last edited by SandrilaFriman on Fri Sep 23, 2022 2:52 am, edited 1 time in total.
SandraLewisFrin
Posts: 15
Joined: Fri Feb 18, 2022 4:44 am

Re: compiling nagios-plugins error with perl

Post 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 check_true.pl, installed it on the remote server and configured NRPE to serve it out as check_test.

The entire script is just:

#!/usr/bin/perl

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):

#!/usr/bin/perl

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):

#!/usr/bin/perl

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?
Post Reply