Page 1 of 1

check_nrpe shows the wrong IPv6 address in error messages

Posted: Mon Sep 25, 2017 10:03 pm
by kohenkatz
Hello all,

I am setting up check_nrpe to query a bunch of servers that all have IPv6 addresses. All machines have NRPE 3.2.1 (and the server has that same version of check_nrpe.

When I run a test:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H myhost.example.com -p 5666 -c check_reboot_required
I get the following error:

Code: Select all

CHECK_NRPE: Error - Could not connect to SOME_IPv6_ADDRESS: Connection reset by peer
The reason for the connection failure is very simple - that IPv6 address is not the address of the machine I am trying to connect to.

All other programs on the Nagios host correctly resolve the IP of the other server. For example, dig AAAA myhost.example.com, host myhost.example.com, ping6 myhost.example.com, and others all get the correct address. Only check_nrpe gets it wrong.

The interesting thing is that the first half of the address is correct. Only the last half is totally messed up. (My boss does not want me to share the IP addresses publicly, but I can PM them if you want.)

If it makes a difference, the Nagios host is on Linode and the NRPE machines are all on AWS EC2.

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 9:26 am
by npolovenko
@kohenkatz Hi Kohenkatz! Could you submit here or pm to me your nrpe.cfg file. It should be located in
/usr/local/nagios/etc/nrpe.cfg
Also, can you upload the plugin as well so we could test it?

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 9:37 am
by kohenkatz
Hello,

It turns out that the issue is not actually as I originally described.

The actual problem for me was that the firewall was still blocking the IPv6 traffic on port 5666.

The fact that the IP address is displayed incorrectly in the output of check_nrpe was a red herring. The whole time it was actually trying to connect to the correct IP address but just displaying the IP address wrong in the error message.

So the next question is this: Should I file a bug report on NRPE on GitHub?

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 9:38 am
by kohenkatz
npolovenko wrote:Also, can you upload the plugin as well so we could test it?
The plugin is this one: https://github.com/yakatz/nagios-plugin ... restart.py

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 9:57 am
by scottwilkerson
Glad it sounds like this is solved.
kohenkatz wrote:So the next question is this: Should I file a bug report on NRPE on GitHub?
This doesn't sound like a bug, because NRPE doesn't configure your firewall so there wouldn't be anything to fix.
kohenkatz wrote:
npolovenko wrote:Also, can you upload the plugin as well so we could test it?
The plugin is this one: https://github.com/yakatz/nagios-plugin ... restart.py
I don't believe this will be necessary since the issue was the firewall

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 10:06 am
by kohenkatz
@scottwilkerson The bug I meant is about the fact that check_nrpe's error message displays the wrong IP address.

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 10:59 am
by kohenkatz

Re: check_nrpe shows the wrong IPv6 address in error message

Posted: Tue Sep 26, 2017 12:37 pm
by tacolover101
nice find.

Image

Re: check_nrpe uses the wrong IPv6 address

Posted: Tue Sep 26, 2017 1:02 pm
by scottwilkerson
Oh, got it! Thanks.