I suppose the logic in the way it's working is that check_nrpe isn't really intended to verify that the nrpe service is running, it's intended to check something else. Admittedly I'm getting the same results and I kind of wish I wasn't. The fix is trivial:
Code: Select all
155 /* try to connect to the host at the given port number */
156 if((sd=my_connect(server_name, &hostaddr, server_port, address_family,
157 bind_address)) < 0 ) {
158 exit (255);
159 }
160 else {
161 result=STATE_OK;
162 }
Code: Select all
[jdalrymple@nagios nrpe-2.15]$ /usr/local/nagios/libexec/check_nrpe -H testhost
connect to address 172.x.x.x port 5666: Connection refused
connect to host testhost port 5666: Connection refused[jdalrymple@nagios nrpe-2.15]$ echo $?
3
If you're so inclined.
Perhaps the more ideal solution is to do a service dependency and a
Code: Select all
[jdalrymple@nagios nrpe-2.15]$ /usr/local/nagios/libexec/check_tcp -H testhost -p 5666
connect to address testhost and port 5666: Connection refused
[jdalrymple@nagios nrpe-2.15]$ echo $?
2
FWIW - I feel the way you do about the way the plugin should behave, and I keep my own source tree for a number of other reasons. This change will be implemented in my own source tree.