On Host B, I run the following:
sudo /usr/bin/python3 /usr/sbin/nrpe-ng --debug -f --config /etc/nagios/nrpe-ng.cfg
While that is running, I run the following on Host A:
/usr/lib/nagios/plugins/check_nrpe_ng -H 192.0.2.2 -c check_dns -a
example.com 192.0.2.3 0.1 1.0
The result of running the command on Host A is:
DNS CRITICAL - '/usr/bin/nslookup -sil' msg parsing exited with no address
On Host B, I see the following debug output:
200 POST /v1/check/check_dns (192.0.2.1) 78.05ms
Executing: /usr/lib/nagios/plugins/check_dns -H
example.com -s 192.0.2.3 -A -w 0.1 -c 1.0
When I run this exact command on Host B, I get:
$ /usr/lib/nagios/plugins/check_dns -H example.com -s 192.0.2.3 -A -w 0.1 -c 1.0 DNS OK: 0.070 seconds response time.
example.com returns 192.0.2.10,2001:db8::10|time=0.069825s;0.100000;1.000000;0.000000
Looks good! When I run nslookup (run by check_dns), it looks good too:
$ /usr/bin/nslookup -sil
example.com 192.0.2.3
Server:
192.0.2.3Address:
192.0.2.3#53
Name:
example.comAddress:
192.0.2.10Name:
example.comAddress: 2001:db8::10
After rerunning nrpe-ng with strace -f, I see something:
[pid 1183842] write(2, "nslookup: ./src/unix/core.c:570:"..., 83) = 83
...
[pid 1183841] read(4, "nslookup: ./src/unix/core.c:570:"..., 4096) = 83
So it appears that the nslookup process is reporting an error. But I cannot reproduce it outside of nrpe-ng.
Any suggestions?
Casey