NRPE Check to local host fails

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.
Locked
krishnar
Posts: 13
Joined: Sun Nov 06, 2016 4:08 pm

NRPE Check to local host fails

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRPE Check to local host fails

Post 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.
Former Nagios employee
krishnar
Posts: 13
Joined: Sun Nov 06, 2016 4:08 pm

Re: NRPE Check to local host fails

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRPE Check to local host fails

Post 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.
Former Nagios employee
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE Check to local host fails

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
krishnar
Posts: 13
Joined: Sun Nov 06, 2016 4:08 pm

Re: NRPE Check to local host fails

Post by krishnar »

This worked!

[root@krishnar1 ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -4
NRPE v3.0.1
[root@krishnar1 ~]#
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRPE Check to local host fails

Post 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
Locked