<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I am trying to track down a bug.  I think it is in nslookup (which is why I'm asking here), but there are so many pieces required to reproduce it that I cannot tell for sure.  Let me explain my setup:<div class=""><br class=""></div><div class="">All hosts are running Debian bullseye.  None of the problems happened *until* I upgraded from buster.</div><div class=""><br class=""></div><div class="">Host A (monitoring):<br class=""> - Installed: nagios4 (4.4.6-4), nrpe-ng (0.2.0-1)<br class=""> - IP address: 192.0.2.1<br class=""><br class="">Host B (monitored):<br class=""> - Installed: nrpe-ng (0.2.0-1), monitoring-plugins-standard (2.3.1-1), bind9-dnsutils (9.16.27-1~deb11u1)</div><div class=""> - IP address: 192.0.2.2<br class=""><br class="">Host C (monitored through host B):<br class=""> - Installed: bind9<br class=""> - IP address: 192.0.2.3<br class=""> - Configured to answer authoritatively for <a href="http://example.com" class="">example.com</a> on port 53.<br class=""><br class=""></div><div class=""><br class=""></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">I run the following on Host B:</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">$ /usr/lib/nagios/plugins/check_dns -H </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><a href="http://example.com" class="">example.com</a></span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""> -s 192.0.2.3 -A -w 0.1 -c 1.0</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">DNS OK: 0.070 seconds response time. </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><a href="http://example.com" class="">example.com</a></span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""> returns 192.0.2.10,2001:db8::10|time=0.069825s;0.100000;1.000000;0.000000</span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Then I run the following on Host B.  check_dns (part of monitoring-plugins-standard) invokes nslookup.  The response looks good.</span></font></div><div class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">When I run nslookup explicitly, it also looks good:</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">$ /usr/bin/nslookup -sil </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><a href="http://example.com" class="">example.com</a></span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""> 192.0.2.3</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Server:</span><span class="Apple-tab-span" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); white-space: pre;">            </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">192.0.2.3</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Address:</span><span class="Apple-tab-span" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); white-space: pre;">      </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">192.0.2.3</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">#53</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Name:</span><span class="Apple-tab-span" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); white-space: pre;"> </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><a href="http://example.com" class="">example.com</a></span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Address: </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">192.0.2.10</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Name:</span><span class="Apple-tab-span" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); white-space: pre;">  </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><a href="http://example.com" class="">example.com</a></span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Address: 2001:db8::10</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class="">Now I set things up for monitoring using nrpe-ng with the following configuration:</div><div class=""><br class=""></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">                 nrpe<br class="">            over HTTPs                      DNS<br class="">Host A ------------------> Host B -------------> Host C</div><div class=""><br class=""></div><br class="">On Host B, I run the following:<br class="">sudo /usr/bin/python3 /usr/sbin/nrpe-ng --debug -f --config /etc/nagios/nrpe-ng.cfg<br class=""><br class="">While that is running, I run the following on Host A:<br class="">/usr/lib/nagios/plugins/check_nrpe_ng -H 192.0.2.2 -c check_dns -a <a href="http://example.com" class="">example.com</a> 192.0.2.3 0.1 1.0</div><div class=""><br class=""></div><div class="">I can see the DNS request and response on the wire (i.e., using tcpdump).<br class=""><br class="">The result of running the command on Host A is:<br class="">DNS CRITICAL - '/usr/bin/nslookup -sil' msg parsing exited with no address</div><div class=""><br class="">On Host B, I see the following debug output:<br class="">200 POST /v1/check/check_dns (192.0.2.1) 78.05ms<br class="">Executing: /usr/lib/nagios/plugins/check_dns -H <a href="http://example.com" class="">example.com</a> -s 192.0.2.3 -A -w 0.1 -c 1.0</div><div class=""><br class=""></div><div class="">(The output matches what I manually ran to test earlier.)<br class=""><br class="">After rerunning nrpe-ng with the following:</div><div class="">sudo strace --read=4 -F /usr/bin/python3 /usr/sbin/nrpe-ng --debug -f --config /etc/nagios/nrpe-ng.cfg</div><div class=""><br class=""></div><div class="">I see the following in the debug output on Host B:</div><div class=""><br class=""></div><div class="">[pid 1390861] read(4, "nslookup: ./src/unix/core.c:570:"..., 4096) = 83<br class=""> | 00000  6e 73 6c 6f 6f 6b 75 70  3a 20 2e 2f 73 72 63 2f  nslookup: ./src/ |<br class=""> | 00010  75 6e 69 78 2f 63 6f 72  65 2e 63 3a 35 37 30 3a  unix/core.c:570: |<br class=""> | 00020  20 75 76 5f 5f 63 6c 6f  73 65 3a 20 41 73 73 65   uv__close: Asse |<br class=""> | 00030  72 74 69 6f 6e 20 60 66  64 20 3e 20 53 54 44 45  rtion `fd > STDE |<br class=""> | 00040  52 52 5f 46 49 4c 45 4e  4f 27 20 66 61 69 6c 65  RR_FILENO' faile |<br class=""> | 00050  64 2e 0a                                          d..              |<br class=""><br class="">So it appears that the nslookup process is reporting an error, specifically from this line of code:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/libuv/libuv/blob/fb76f210eb6f093bc06a2f07646e56851818ccf2/src/unix/core.c#L602" class="">https://github.com/libuv/libuv/blob/fb76f210eb6f093bc06a2f07646e56851818ccf2/src/unix/core.c#L602</a></div><div class=""><br class=""></div><div class="">However, I cannot reproduce it outside of nrpe-ng/check_dns/nslookup.  I need the help of someone more knowledgeable.  Thoughts?  Suggestions?<br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Casey</div></body></html>