Page 1 of 2

Error Compiling NRPE

Posted: Tue Nov 04, 2014 12:06 pm
by deaqo
Hi All

I hope somebody could lead me in this error. I am triyng to setting up nrpe agent at AIX server, I just downloaded the binaries for AIX and just trying to set it up, but when I try to test the configuration locally just to see if the Nagios server is able to reach out the AIX server, running the following line:

Code: Select all

$ /usr/local/nagios/libexec/check_nrpe -H 192.168.1.20 -c check_disk -a 60 80 /
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
and the nrpe.log shows something like this

Code: Select all

Error: Request contained command arguments!
Client request was invalid, bailing out...
I was trying to find out in Internet the solution for this type of error and says that I need to recompile the nrpe just liske this:

Code: Select all

./configure --enable-command-args
I did it whit no error:

Code: Select all

*** Generating DH Parameters for SSL/TLS ***
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time
.......+........................................+......................................................................+.......+............+..........+..........................................................................+......+......................+...............+.......+..................................+.......+..............................+.......+.........................................................+.+...................+.....+..........................+..+...................+..++*++*++*++*++*++*
checking for Kerberos include files... could not find include files
checking for perl... /usr/bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating subst
config.status: creating include/config.h
config.status: include/config.h is unchanged


*** Configuration summary for nrpe 2.12 03-10-2008 ***:

 General Options:
 -------------------------
 NRPE port:    5666
 NRPE user:    nagios
 NRPE group:   nagios
 Nagios user:  nagios
 Nagios group: nagios


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the NRPE daemon and client.
but when I try run "make all" like the message says, it gives me error

Code: Select all

make all
        cd ./src/; make ; cd ..
        gcc -g -O2 -I/usr/include/openssl -I/usr/include -DHAVE_CONFIG_H -c ./snprintf.c
In file included from /usr/include/fcntl.h:188,
                 from ./../include/config.h:143,
                 from ./snprintf.c:108:
/usr/include/unistd.h:935: error: expected ')' before '[' token
/usr/include/unistd.h:936: error: expected declaration specifiers or '...' before 'rid_t'
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 2.

Stop.

and do nothing

anyone could help me with this error? Because I don't know what else to do

Thank you All!

Best Regards!!

Re: Error Compiling NRPE

Posted: Tue Nov 04, 2014 4:38 pm
by abrist
What version of nrpe are you trying to build?

Re: Error Compiling NRPE

Posted: Wed Nov 05, 2014 11:46 am
by josnavch
You can try to modify the configuration file in the following lines nrpe.cfg

# COMMAND ARGUMENT PROCESSING
# This option Determines whether or not the NRPE daemon will allow clients
# Specify arguments to commands to That are Executed. This option only works
# If the daemon configured WAS With The --enable-command-args configure script
# Option.
#
# *** ENABLING THIS OPTION IS A SECURITY RISK! ***
# Read the SECURITY file for information on some of the security Implications
# Of Enabling this variable.
#
# Values​​: 0 = do not allow arguments, 1 = allow command arguments

dont_blame_nrpe = 0


modify by

dont_blame_nrpe = 1

After service nrpe restart and try the command again

Code: Select all

$ /usr/local/nagios/libexec/check_nrpe -H 192.168.1.20 -c check_disk -a 60 80 /
Similarly I would say you should try running on the AIX server rather than from the nagios server to validate that the problem is in the NRPE configuration or external to NRPE so this affects you

The test can do so

Code: Select all

$ /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk -a 60 80 /

Re: Error Compiling NRPE

Posted: Wed Nov 05, 2014 11:55 am
by abrist
josnavch wrote:You can try to modify the configuration file in the following lines nrpe.cfg
This is usually a good suggestion, but it looks like the OP is running into build issues. We need to resolve the build issues and get nrpe installed before moving into runtime troubleshooting.

Re: Error Compiling NRPE

Posted: Wed Nov 19, 2014 6:06 pm
by deaqo
abrist wrote:What version of nrpe are you trying to build?
Hi abrist, sorry for late answer...I'm running nrpe version 2.12

Thanks

Re: Error Compiling NRPE

Posted: Wed Nov 19, 2014 6:17 pm
by deaqo
josnavch wrote:You can try to modify the configuration file in the following lines nrpe.cfg

# COMMAND ARGUMENT PROCESSING
# This option Determines whether or not the NRPE daemon will allow clients
# Specify arguments to commands to That are Executed. This option only works
# If the daemon configured WAS With The --enable-command-args configure script
# Option.
#
# *** ENABLING THIS OPTION IS A SECURITY RISK! ***
# Read the SECURITY file for information on some of the security Implications
# Of Enabling this variable.
#
# Values​​: 0 = do not allow arguments, 1 = allow command arguments

dont_blame_nrpe = 0


modify by

dont_blame_nrpe = 1

After service nrpe restart and try the command again

Code: Select all

$ /usr/local/nagios/libexec/check_nrpe -H 192.168.1.20 -c check_disk -a 60 80 /
Similarly I would say you should try running on the AIX server rather than from the nagios server to validate that the problem is in the NRPE configuration or external to NRPE so this affects you

The test can do so

Code: Select all

$ /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk -a 60 80 /
Hi josnavch

Sorry for answer so late, but i was very busy. Well I have tried everything that you suggest here, but no luck.

If a run: /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk -a 60 80 /

the server says: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

and checking at the nagios log, it says:
Error: Request contained command arguments!

the same error.

And trying to find the answer on Internet, and they suggest recompile the nrpe agent, like this:

./configure --enable-command-args

But when I type "make all" I got the error post before, and I think the error must be with gcc and it's libraries, but don't know how to make it works.

Thank you

Re: Error Compiling NRPE

Posted: Wed Nov 19, 2014 6:35 pm
by Box293

Re: Error Compiling NRPE

Posted: Wed Nov 26, 2014 10:21 am
by deaqo
Hi All

¿Anybody can guide me through out a solution for this situation? please right now I don't know what to do in this case. :(

Re: Error Compiling NRPE

Posted: Wed Nov 26, 2014 10:41 am
by tmcdonald
Did you take a look at the link @Box293 posted?

Re: Error Compiling NRPE

Posted: Thu Dec 04, 2014 10:39 am
by deaqo
tmcdonald wrote:Did you take a look at the link @Box293 posted?
Hi tmcdonald, yes I did take a look of what Box293 posted, but whit no luck.

Finally I got the solution for this. Seems like AIX got a lot of trouble with the C compiler because you need to identify some prerequisites with NRPE agent, but somebody just guide me to a website where are some files precompiles and there it was NRPE precompile with "--enable-command-args" that's what i need it in first place, so I downloaded and unzipped in the right directories and restart the service indeed and when I run the command:

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_disk -a 60 80 /

Like somebody put it before, I got this answer:

DISK OK - free space: /home 2047 MB (99% inode=99%);| /home=0MB;1958;1953;0;2048

It works fine.

So, I put the link where you can find precompiles files not just for AIX, and for HP/UX, Solari, IRIX, etc. the link is: http://www.gbl-software.de/nagiosbinaries/index.html

Hope this could help anyone with the same situation I got here.

Best regards, and thanks to all who reply to me.

Take Care!