Monitor services on remote linux host

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.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Monitor services on remote linux host

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Monitor services on remote linux host

Post by Ravikimt »

nrpe.cfg
remote host nrpe.cfg file
(12.18 KiB) Downloaded 371 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 =
}
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Monitor services on remote linux host

Post 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.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Monitor services on remote linux host

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Monitor services on remote linux host

Post 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.
Attachments
NRPE.pdf
(218.16 KiB) Downloaded 211 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor services on remote linux host

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: Monitor services on remote linux host

Post by Ravikimt »

I have resolved my problem so you can close this topic.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor services on remote linux host

Post by scottwilkerson »

Great good to hear it is resolved.

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked