check_nrpe shows the wrong IPv6 address in error messages

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
kohenkatz
Posts: 5
Joined: Mon Sep 25, 2017 9:53 pm

check_nrpe shows the wrong IPv6 address in error messages

Post 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.
Last edited by kohenkatz on Tue Sep 26, 2017 11:05 am, edited 1 time in total.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: check_nrpe uses the wrong IPv6 address

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kohenkatz
Posts: 5
Joined: Mon Sep 25, 2017 9:53 pm

Re: check_nrpe uses the wrong IPv6 address

Post 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?
kohenkatz
Posts: 5
Joined: Mon Sep 25, 2017 9:53 pm

Re: check_nrpe uses the wrong IPv6 address

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe uses the wrong IPv6 address

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
kohenkatz
Posts: 5
Joined: Mon Sep 25, 2017 9:53 pm

Re: check_nrpe uses the wrong IPv6 address

Post by kohenkatz »

@scottwilkerson The bug I meant is about the fact that check_nrpe's error message displays the wrong IP address.
kohenkatz
Posts: 5
Joined: Mon Sep 25, 2017 9:53 pm

Re: check_nrpe uses the wrong IPv6 address

Post by kohenkatz »

User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: check_nrpe shows the wrong IPv6 address in error message

Post by tacolover101 »

nice find.

Image
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe uses the wrong IPv6 address

Post by scottwilkerson »

Oh, got it! Thanks.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked