Page 2 of 2

Re: Monitor services on remote linux host

Posted: Tue May 22, 2018 4:53 pm
by npolovenko
@Ravikimt, I don't think Nagios server needs to listen on port 5666. So you're good.
Please go over this tutorial and add the Nagios IP address to the allowed hosts:
https://support.nagios.com/kb/article/n ... e-615.html

Are you running the nrpe under xinetd or as a standalone daemon on the remote server?
Please upload the nrpe.cfg file from the remote server.
On the remote server please run:

Code: Select all

ps -ef | grep xinetd
ps -ef | grep nrpe

Re: Monitor services on remote linux host

Posted: Wed May 23, 2018 12:52 am
by Ravikimt
nrpe.cfg
remote host nrpe.cfg file
(12.18 KiB) Downloaded 404 times
Yes, I am running the nrpe under xinetd not standalone.

I ran below commands on remote host and please have a look at the output.

root@ubuntu:~$ ps -ef | grep xinetd
localad+ 16398 16242 0 05:37 pts/2 00:00:00 grep --color=auto xinetd
root 100279 1 0 May19 ? 00:00:00 /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6

root@ubuntu:~$ ps -ef | grep nrpe
localad+ 16425 16242 0 05:37 pts/2 00:00:00 grep --color=auto nrpe
nagios 104360 1 0 May22 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f

Both the processes are running on remote host. I have uploaded nrpe.cfg file also. Please review the config once.

I checked /etc/xinetd.d/nrpe file also. I can see service disable option is "yes" Is it correct.?

service nrpe
{
disable = yes
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
only_from = 127.0.0.1,<ngios server ip>
log_on_success =
}

Re: Monitor services on remote linux host

Posted: Wed May 23, 2018 5:11 am
by Ravikimt
I ran this command from Nagios server and I got below output.

root@ubuntu$:- /usr/local/nagios/libexec/check_nrpe -H 10.10.xxx.xx
CHECK_NRPE: Error - Could not connect to 10.10.105.xx: Connection reset by peer.

After getting this error I checked /var/logs/syslog/ on my Nagios server. It says cloud not complete SSL handshake with remote host.

May 23 15:33:37 tredence check_nrpe: Error: (nerrs = 0)(!log_opts) Could not complete SSL handshake with 10.10.105.59: rc=-1 SSL-error=5
May 23 15:35:37 tredence check_nrpe: Error: (nerrs = 0)(!log_opts) Could not complete SSL handshake with 10.10.105.59: rc=-1 SSL-error=5

Please hep me here It's little bit urgent.

Re: Monitor services on remote linux host

Posted: Thu May 24, 2018 10:49 am
by npolovenko
@Ravikimt,

IP addresses in etc/xinetd.d/nrpe need to be separated by spaces, and not by commas. So instead of:

Code: Select all

only_from = 127.0.0.1,<ngios server ip>
use

Code: Select all

only_from = 127.0.0.1 <ngios server ip>
Change disable to no.

Here is my config:

Code: Select all

{
        flags           = REUSE
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
        only_from       = 127.0.0.1 192.168.4.172
}
When done please restart the xinetd:

Code: Select all

service xinetd restart
I'm also not sure why both processes are running on your server. Go ahead and stop the nrpe process if you're going to be using the one under xinetd:

Code: Select all

service nrpe stop
What tutorials did you use to install the nrpe?

Re: Monitor services on remote linux host

Posted: Thu May 24, 2018 10:53 pm
by Ravikimt
@npolovenko I made the changes in nrpe file (/etc/xitend/nrpe) as you suggested. But If I stop the nrpe service on Nagios remote host.

After that also I am facing the same problem and I attached the nrpe.pdf document which I have followed to install nrpe on remote host.

Please have a look and help me.
Thanks in advance.

Re: Monitor services on remote linux host

Posted: Fri May 25, 2018 12:32 pm
by scottwilkerson
if you stop it from running by itself

Code: Select all

service nrpe stop
you can run NRPE directly under xinetd.

Code: Select all

service xinetd restart
It can only run under initd OR xinetd.... not both.

Re: Monitor services on remote linux host

Posted: Fri Jun 01, 2018 5:47 am
by Ravikimt
I have resolved my problem so you can close this topic.

Re: Monitor services on remote linux host

Posted: Fri Jun 01, 2018 7:01 am
by scottwilkerson
Great good to hear it is resolved.

Locking