Page 1 of 1

NRPE Check to local host fails

Posted: Wed Mar 15, 2017 11:55 am
by krishnar
Hello All,

I am a newbie to Nagios. I'm in process of setting up Nagios NRPE in my lab host. I'm facing this issue when I test NRPE setup.

[root@krishnar1 nrpe-3.0.1]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
NRPE v3.0.1

[root@krishnar1 nrpe-3.0.1]# /usr/local/nagios/libexec/check_nrpe -H localhost
CHECK_NRPE: Error - Could not connect to ::3668:6c6e:7556:0: Connection reset by peer
[root@krishnar1 nrpe-3.0.1]#

I'm wondering why check to localhost fails, but check to 127.0.0.1 works!

Re: NRPE Check to local host fails

Posted: Wed Mar 15, 2017 2:08 pm
by tmcdonald
I would look at your /etc/hosts file for starters, looks like localhost may not be resolving properly. Could also be a misconfigured DNS I suppose, but this is far more likely.

Re: NRPE Check to local host fails

Posted: Wed Mar 15, 2017 2:16 pm
by krishnar
[user@krishnar1 ~]$ /usr/local/nagios/libexec/check_nrpe -H localhost
CHECK_NRPE: Error - Could not connect to ::3668:6c6e:7556:0: Connection reset by peer

[user@krishnar1 ~]$ host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1



[user@krishnar1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

I think I have the proper DNS config.

Re: NRPE Check to local host fails

Posted: Wed Mar 15, 2017 2:32 pm
by tmcdonald
That is very odd. Do you need IPv6 enabled? I was able to find a blog post in Chinese (translated below) that references that exact IPv6 address:

https://translate.google.com/translate? ... t=&act=url

though I could not find it referenced anywhere else. The article recommends disabling IPv6, though I am not sure why that specific IP would be used for localhost.

Re: NRPE Check to local host fails

Posted: Wed Mar 15, 2017 2:32 pm
by lmiltchev
Do the commands below work for you?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost -4
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Can you disable ipv6 on this box (unless you need it), and try again?

Re: NRPE Check to local host fails

Posted: Wed Mar 15, 2017 5:47 pm
by krishnar
This worked!

[root@krishnar1 ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -4
NRPE v3.0.1
[root@krishnar1 ~]#

Re: NRPE Check to local host fails

Posted: Thu Mar 16, 2017 1:55 pm
by ssax
Great, is there anything else we can help you with on this or are we okay to mark this as resolved and lock the topic?

Thank you