Small patch for check_nrpe.c

Ethan Galstad nagios at nagios.org
Tue Dec 12 02:51:39 CET 2006


Mark Plaksin wrote:
> Here's a small patch which makes check_nrpe close the socket gracefully
> when it's done.  This resolved a problem we were having with spurious
> timeouts.  We've been running it on our production Nagios instance (200
> hosts, 5000 services; most services use NRPE) for a week and it's working
> great.
> 
> Before the patch, check_nrpe_ssl was timing out when trying to connect to
> hosts that were definitely up.  A local expert (Jay Cotton) looked at our
> sniffer trace, explained the problem, and offered a fix.  The server end
> was "ungracefully" closing the socket connected to the client.  For some
> reason (NAT device in the middle, TCP stack on the HP-UX 11.11 client,
> or?), the client thought the connection was still open.  The client
> continues saying FIN after the server has sent RST.  The client keeps the
> connection in the LAST_ACK state for several minutes.
> 
> That's not so bad in itself but we were unlucky enough to have our server
> (Debian stable box running a 2.6 kernel) attempt a new connection to the
> same client using the same source port!  The client thought it was already
> talking to the server on that port so it didn't play along and
> check_nrpe_ssl on the server timed out.
> 
> Closing the connection gracefully eliminated the problem.  Below is Jay's
> note describing his fix.
> 
> Thanks!
> 

This patch will be applied to CVS shortly (with some mods to handle a 
missing closesocket() function on some OSes) and included with the NRPE 
2.6 release.  Thanks!


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list