Page 3 of 5

Re: bin folder missing from /usr/local/nagios

Posted: Wed Nov 16, 2016 11:21 am
by rkennedy
katya wrote:Hi,
It very starnge but if i will run check_nrpe to mu nagios server (10.146.1.100) it will work

root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 10.146.1.100
NRPE v2.15

but if i will run to 127.0.0.1 it woul not. why? what is the difference?


root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1
CHECK_NRPE: Error - Could not complete SSL handshake.
You probably have not allowed 127.0.0.1 in your 'allowed_hosts' part. The difference is 10.146.1.100 has sspmutu's IP in it's allowed_hosts.

Re: bin folder missing from /usr/local/nagios

Posted: Wed Nov 16, 2016 3:23 pm
by katya
127.0.0.1 is allowed in my nrpe.cfg it ssbpmutu server.

so this is not the issue, any other idea?

please see the evidnce:
/usr/local/nagios/etc
vi nrpe.cfg
allowed_hosts=127.0.0.1,10.146.1.100,10.146.1.35

Re: bin folder missing from /usr/local/nagios

Posted: Wed Nov 16, 2016 5:32 pm
by tgriep
Login to you Solaris server and run the following.

Code: Select all

 ./check_nrpe -H 127.0.0.1 -n
If it returns the version of the NRPE Agent, that means that the NRPE agent did not get compiled with SSL enabled.
Try recompiling it again by following these instructions.
https://www.rootusers.com/compiling-nrp ... aris-11-2/

Re: bin folder missing from /usr/local/nagios

Posted: Thu Nov 17, 2016 9:22 am
by katya
root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1 -n
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.


from /var/adm/messages

Nov 17 09:21:19 ssbpmutu su: [ID 366847 auth.notice] 'su root' succeeded for katya.ailarov on /dev/pts/2
Nov 17 09:21:19 ssbpmutu su: [ID 366847 auth.notice] 'su root' succeeded for katya.ailarov on /dev/pts/2
Nov 17 09:21:42 ssbpmutu inetd[395]: [ID 317013 daemon.notice] nrpe[14787] from 127.0.0.1 53752
Nov 17 09:21:42 ssbpmutu inetd[395]: [ID 317013 daemon.notice] nrpe[14787] from 127.0.0.1 53752
Nov 17 09:21:42 ssbpmutu nrpe[14787]: [ID 927837 mail.info] connect from localhost
Nov 17 09:21:42 ssbpmutu tcpd[14787]: [ID 826424 mail.error] error: cannot execute /application/nagios/bin/nrpe: No such file or directory
Nov 17 09:22:09 ssbpmutu sshd[14292]: [ID 800047 auth.info] Received disconnect from 10.146.1.100: 11: Terminating connection
Nov 17 09:22:09 ssbpmutu sshd[14292]: [ID 800047 auth.info] Received disconnect from 10.146.1.100: 11: Terminating connection

Re: bin folder missing from /usr/local/nagios

Posted: Thu Nov 17, 2016 2:37 pm
by tgriep
Instead of taking the time to figure out why the old NRPE Agent didn't install on the Solaris server, try using the instructions below to install a newer version of the NRPE agent.
https://support.nagios.com/kb/article.php?id=515

Re: bin folder missing from /usr/local/nagios

Posted: Tue Nov 22, 2016 9:45 am
by katya
Hi,

i followed this procedure all the steps were done successfuly.

but when running check_nrpe got the following error:

root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1
CHECK_NRPE: Error - Could not connect to 127.0.0.1. Check system logs on 127.0.0.1

output from /var/adm/messages/:
Nov 22 09:39:11 ssbpmutu check_nrpe[21098]: [ID 130467 user.error] Error: Could not complete SSL handshake with 127.0.0.1: rc=0 SSL-error=5

Re: bin folder missing from /usr/local/nagios

Posted: Tue Nov 22, 2016 2:46 pm
by tgriep
It looks like the the SSL libraries are not installed on your server or that they did not get compiled in to the NRPE Agent.
Make sure that the SSL libraries are installed on your server and then run these commands to see if you can get SSL compiled in to the NRPE Agent and the check_nrpe command.

Code: Select all

cd /tmp/nrpe-3.0/
./configure --enable-command-args –with-ssl=/usr/sfw/ –with-ssl-lib=/usr/sfw/lib/ –with-ssl-inc=/usr/sfw/include
gmake all
If it compiles without any errors, run this to install the agent

Code: Select all

gmake install-init
Then run this to restart the agent on the server

Code: Select all

svcadm disable nrpe
svcadm enable nrpe

Re: bin folder missing from /usr/local/nagios

Posted: Wed Nov 23, 2016 12:22 pm
by katya
root@ssbpmutu:/tmp/nrpe-3.0# ./configure --enable-command-args -with-ssl=/usr/sfw/ -with-ssl-lib=/usr/sfw/lib/ -with-ssl-inc=/usr/sfw/include
*** Configuration summary for nrpe nrpe-3.0 07-12-2016 ***:

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
or type 'make' to get a list of make options.

You have mail in /var/mail/root
root@ssbpmutu:/tmp/nrpe-3.0# gmake all
cd ./src/; gmake
gmake[1]: Entering directory `/tmp/nrpe-3.0/src'
gcc -g -O2 -I/usr/sfw/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -L/usr/sfw/lib/ -lssl -lcrypto -lnsl -lsocket
gcc -g -O2 -I/usr/sfw/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o check_nrpe ./check_nrpe.c ./utils.c -L/usr/sfw/lib/ -lssl -lcrypto -lnsl -lsocket
gmake[1]: Leaving directory `/tmp/nrpe-3.0/src'

*** Compile finished ***

You can now continue with the installation or upgrade process.

Read the PDF documentation (NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.

You have new mail in /var/mail/root
root@ssbpmutu:/tmp/nrpe-3.0# gmake install-init
build-aux/install-sh -c -m 775 -g sys -d /var/svc/manifest/network/nagios
build-aux/install-sh -c -m 644 startup/solaris-init.xml /var/svc/manifest/network/nagios/nrpe.xml
svccfg import /var/svc/manifest/network/nagios/nrpe.xml
*** Run 'svcadm enable nrpe' to start it
root@ssbpmutu:/tmp/nrpe-3.0# svcadm disable nrpe
root@ssbpmutu:/tmp/nrpe-3.0# svcadm enable nrpe
root@ssbpmutu:/tmp/nrpe-3.0# cd /usr/local/nagios/libexec/
root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1
CHECK_NRPE: Error - Could not connect to 127.0.0.1. Check system logs on 127.0.0.1
root@ssbpmutu:/usr/local/nagios/libexec#

Agian not working :(

Re: bin folder missing from /usr/local/nagios

Posted: Wed Nov 23, 2016 1:43 pm
by tgriep
Try running this command on the Solaris server to see if it works.

Code: Select all

 ./check_nrpe -H 127.0.0.1 -n
What the -n does is to connect to the NRPE agent without SSL and if it works, then the agent did not get ssl compiled in to it and you will have to use the -n option in the check_nrpe command in the checks for that server.

Re: bin folder missing from /usr/local/nagios

Posted: Thu Nov 24, 2016 6:45 am
by katya
root@ssbpmutu:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1 -n
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).